Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organise existing translation keys #666

Open
wbazant opened this issue Jan 17, 2025 · 3 comments
Open

Organise existing translation keys #666

wbazant opened this issue Jan 17, 2025 · 3 comments
Assignees

Comments

@wbazant
Copy link
Collaborator

wbazant commented Jan 17, 2025

The keys are have been added without structure, like 'back' or 'Loading'. Review the JSON and move them around (and update the source code). Don't change keys used by the live site.

@wbazant wbazant self-assigned this Jan 17, 2025
@wbazant
Copy link
Collaborator Author

wbazant commented Jan 17, 2025

Here's a table of new translation keys:

src/components/entry/EntryOverview.js	added_by
src/components/about/AboutDatasetPage.js	back
src/components/about/PageTemplate.js	back
src/components/desktop/SidePane.js	back
src/components/desktop/SidePane.js	back
src/components/desktop/SidePane.js	back
src/components/desktop/SidePane.js	back
src/components/desktop/SidePane.js	back
src/components/profile/UserProfile.js	back
src/components/activity/ChangesPeriod.jsx	changes.type
src/components/filter/FilterButtons.js	deselect_all
src/components/auth/ConfirmationPage.js	devise.confirmations.no_token
src/components/entry/EntryOverview.js	edited_on
src/components/auth/AccountPage.js	form.button.reset
src/components/auth/SignupPage.js	form.button.reset
src/components/table/ShareTheHarvestTable.jsx	glossary.brazil
src/components/table/ShareTheHarvestTable.jsx	glossary.czechia
src/components/mobile/Tabs.js	glossary.list
src/components/filter/Filter.js	glossary.types
src/components/form/TypesSelect.js	glossary.types
src/components/settings/SettingsPage.js	imperial
src/components/entry/EntryOverview.js	imported_from
src/components/filter/Filter.js	invasives
src/components/settings/SettingsPage.js	language
src/components/desktop/Header.js	layouts.application.menu.the_data
src/components/settings/SettingsPage.js	layouts.application.menu.the_data
src/components/desktop/MainSidePane.js	menu.zoom_in_to_add_location
src/components/map/MapPage.js	menu.zoom_in_to_add_location
src/components/settings/SettingsPage.js	metric
src/components/filter/Filter.js	only_on_map
src/components/ui/LabelTag.js	optional
src/components/table/ImportsTable.jsx	pages.datasets.type
src/components/about/DataPage.js	pages.datasets.types_of_data
src/components/settings/SettingsPage.js	poi
src/components/form/ReportModal.js	problems.problem_type
src/components/ui/LabelTag.js	required
src/components/settings/SettingsPage.js	roadmap
src/components/filter/FilterButtons.js	select_all
src/components/desktop/SidePane.js	settings
src/components/desktop/SidePane.js	settings
src/components/mobile/Tabs.js	settings
src/components/settings/SettingsPage.js	settings
src/components/settings/SettingsPage.js	side_menu.bicycle
src/components/settings/SettingsPage.js	side_menu.regional
src/components/settings/SettingsPage.js	side_menu.satellite
src/components/settings/SettingsPage.js	side_menu.terrain
src/components/settings/SettingsPage.js	side_menu.transit
src/components/filter/Filter.js	type
src/components/settings/SettingsPage.js	units
src/components/auth/AccountPage.js	users.new_password_confirmation
src/components/auth/PasswordSetPage.js	users.new_password_confirmation
src/components/auth/SignupPage.js	users.password_confirmation

Generated by

scripts/translation_manager.py --source_path src --list-in-source | perl -nE 'my ($file, $k) = split ("\t"); print if $k =~ m{added_by|back|deselect_all|devise.confirmations.no_token|edited_on|form.button.reset|form.error.confirmation|form.error.missing_password|form.error.too_short|glossary.brazil|glossary.czechia|glossary.list|imperial|imported_from|invasives|language|layouts.application.menu.the_data|menu.zoom_in_to_add_location|metric|only_on_map|optional|poi|required|roadmap|select_all|settings|side_menu.bicycle|side_menu.regional|side_menu.satellite|side_menu.terrain|side_menu.transit|type|units|users.new_password_confirmation|users.password_confirmation|users.sign_out}' 

The list itself was added by a dummy translation in Polish, and comparing keys in en/pl with

comm -13 <( scripts/translation_manager.py --yaml_folder_path ../falling-fruit/config/locales/ --json_folder_path ./public/locales/ --source_path src --list-in-json | grep pl.json | cut -f 2 | sort ) <( scripts/translation_manager.py --yaml_folder_path ../falling-fruit/config/locales/ --json_folder_path ./public/locales/ --source_path src --list-in-json | grep en.json | cut -f 2 | sort )

@wbazant
Copy link
Collaborator Author

wbazant commented Jan 20, 2025

Also, the English translation has some keys that aren't used by the code:

changes.type.grafted grafted
form.error.confirmation Does not match original
form.error.missing_password Required to change email or password
form.error.too_short Minimum of {{min}} characters
users.sign_out Sign out

@wbazant wbazant reopened this Jan 21, 2025
@wbazant wbazant changed the title Organise newly added translation keys Organise existing translation keys Jan 21, 2025
@wbazant
Copy link
Collaborator Author

wbazant commented Jan 21, 2025

Also, give the JSON structure so that the path explains what the translation key is for, for example:

glossary.united_kingdom -> pages.sharing.countries.united_kingdom

The glossary should ideally mostly have domain language terms specific to Falling Fruit, like yield or quality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant