electricitymaps / electricitymaps-contrib

A real-time visualisation of the CO2 emissions of electricity consumption
https://app.electricitymaps.com
GNU Affero General Public License v3.0
3.47k stars 924 forks source link

Better translations #7091

Open phiphou opened 3 weeks ago

phiphou commented 3 weeks ago

Working on a french translation, I came to an issue.

The key "comes from" should give "vient de".

But the full sentence "... comes from solar" should give "vient DU solaire".

And if it comes from wind, it would give "vient DE L'élien".

And for geothermy, it would give "vient DE LA géothermie".

I finaly replaced the wording "comes from" by a translation for "is generated by".

It allows a better translation, "...comes from solar" becomes "...est générée par solaire".

But that's not perfect, the good translation should be "...est générée par DU solaire", or for wind "...est générée par DE L'éolien".

One solution would be to add different translation keys for each energy sources, like this :

{
  "comesFrom_wind": "est générée par de l'",
  "comesFrom_solar": "est générée par du",
  "comesFrom_geothermy": "est générée par de la"
}

Any french speaker can give us his views on this point ?

It also may touch languages like german (der/die/das)...

VIKTORVAV99 commented 3 weeks ago

@tonypls what is your take on this?

It means we would have to revise the logic on the tooltips a bit but it's doable.

phiphou commented 3 weeks ago

Please let me know when you dive in this ;)

phiphou commented 3 weeks ago

Forgot to mention the problem is the same with keys "electricityStoredUsing" and "emissionsStoredUsing".

"...is stored using wind" should give "...est stockée en utilisant [de l' / l'] éolien", and not "...est stockée en utilisant éolien".

"...is stored using solar" should give "...est stockée en utilisant [le / du] solaire", and not "...est stockée en utilisant solaire".

Use the "via" word may help, we would have "...est stockée via éolien". That's not perfect but probably better.

It would be usefull to have feedback on this from french speakers...

VIKTORVAV99 commented 3 weeks ago

Forgot to mention the problem is the same with keys "electricityStoredUsing" and "emissionsStoredUsing".

"...is stored using wind" should give "...est stockée en utilisant [de l' / l'] éolien", and not "...est stockée en utilisant éolien".

"...is stored using solar" should give "...est stockée en utilisant [le / du] solaire", and not "...est stockée en utilisant solaire".

Use the "via" word may help, we would have "...est stockée via éolien". That's not perfect but probably better.

It would be usefull to have feedback on this from french speakers...

I don't know French but how would this work with hydro and battery. Would it be the same for those? (those are the only storage modes we support at the moment).

phiphou commented 3 weeks ago

yes, It works the same, idealy we shoud apply the multiple keys solution for these two other keys.

But the semi-solution I proposed in my last PR (using the "via" word) works not so bad in these two cases. ("is stored using wind" becomes "est stockée via éolien").

It could be interessting to know if this "problem" appears in some other locales, I understand it may not be a good thing to change the logic for only one specific locale.

jarek commented 3 weeks ago

In https://github.com/electricitymaps/electricitymaps-contrib/issues/3869#issuecomment-1141142025 I was discussing grammar problems with translations, specifically for Polish, which is heavily inflected:

If you would be willing to update the rendering script to use [correct grammar form] as appropriate if provided in the localization file, and fallback to [nominative form] if not set, we can make updates to the Polish localization file to match.

Somewhat related, the Polish localization of electricityComesFrom is in format "Country X: S-ish production creates 30% of electricity" where "S-ish" is the source in adjective form (essentially "coal-ish", "hydro-ish") to avoid needing two different cases for nouns of energy sources: nominative "coal" and "from coal".

Perhaps a grammar-based approach would also help for French?

So we could have:

solar: "solaire" wind: "éolien" geothermal: "géothermie"

comesFrom: "est générée par" or "vient" isStoredUsing: "est stockée en utilisant"

solarFrom: "du solaire" windFrom: "de l'éolien" geothermalFrom: "de la geothermie"

batteryFrom: a different inflected form than plain battery hydroFrom: a different inflected form than plain pumped hydro batteryInto: potentially yet another different inflected form hydroInto: potentially yet another different inflected form

(Sorry if I got the French grammar wrong, but hopefully you get the idea)

This would also help with grammar in Polish translations, which have always been stilted since we only have nominative case:

wind: "wiatr" windFrom: "z wiatru" gas: "gaz" gasFrom: "z gazu" etc

phiphou commented 3 weeks ago

Glad to know the problem is not for french only ;)