falling-fruit / falling-fruit-web

Mobile-friendly website for Falling Fruit
https://beta.fallingfruit.org
GNU General Public License v3.0
40 stars 26 forks source link

Apply the existing translations in the location page #488

Open wbazant opened 1 month ago

wbazant commented 1 month ago

This issue is related to #487 (and the ultimate goal is to translate the whole site).

Change the language to French, then go to a page like http://localhost:3000/locations/1989712. There are many untranslated lines, for example "Fruiting status" is still in English.

We already have translations for many of the strings on the old site, for example, that one is at locations.form.fruiting_status, which I can see here: https://github.com/falling-fruit/falling-fruit/blob/main/config/locales/en.yml#L231

We want to leverage the translations which we already have. It could be good to use AI translations for a first pass since they're great in 2024, but we'd like to figure out a workflow for them - maybe a query to the language model with a glossary for a reference - so try to solve the issue with the ultimate goal in mind.

Relatedly, switching the locale to French, and putting any English words into the little command line program ag is a great way to find out where in the source code to make changes:


wbazant@wbazant-19-01:~/dev/falling-fruit-web$ ag 'Summary'
...
src/components/entry/ReviewSummary.js
...
141:      <h3>Summary</h3>
...
wbazant@wbazant-19-01:~/dev/falling-fruit-web$ ag 'Fruiting status'
src/components/form/ReviewForm.js
64:      label="Fruiting status"
wbazant@wbazant-19-01:~/dev/falling-fruit-web$ ag 'Added by'
public/locales/en.json
19:  "added_by": "Added by {{name}}",
ezwelty commented 1 month ago

I'll reiterate this point: We want to leverage the translations which we already have.

The current website (https://fallingfruit.org) has been translated by humans in 10 languages. That locale data is available at https://github.com/falling-fruit/falling-fruit/tree/main/config/locales

The keys can be found in-situ on the old website by using this link: https://fallingfruit.org/?i18n_viz=1 And navigating around and hovering over text snippets.

When migrating over these existing translations, use the same exact key names as used by the old website, so that we can benefit from the existing translations.

p.s. I'll also add that when possible, try to remove the need for words with good styling. Because words need to be translated...