Yellow-Dog-Man / Locale

Locale files for Resonite
MIT License
26 stars 101 forks source link

Add a way to localise units in different languages #186

Open jae1911 opened 8 months ago

jae1911 commented 8 months ago

While working on the French locale, I noticed that some stuff, notably storage units, can't be translated.

For instance: Resonite_0zphNcY28X

With the translation key that looks like "Indicator.Storage.Usage": "{storage_used} de {storage_max}<br><size=61.803%>Stockage utilisé</size>",

On this facet, while the text is correct, the direct translation of the unit "GB" in French would be "Go" instead (for "Gigaoctet"). I also think about Finnish which translates "GB" to "Gt" as well.

Frooxius commented 8 months ago

Can you provide more context for this? My assumption is that the storage units are generally universal and would go like kB, MB, GB, TB regardless of language.

Are you saying that different languages handle those sequences differently?

I'm not sure what would be the best approach here, because the actual unit is formatted externally based on the value. So we'd probably need to provide definitions for the common ones in the locale.

jae1911 commented 8 months ago

Basically, in French (and some other languages), storage units have a direct translation. For instance, "Byte" becomes "Octet" (though "Octet" also exists in English but is rarer to encounter).

I want to use "Ko", "Go", "To", etc, instead of "GB" in French translations due to "Go" being way more common in French content and everyday life.

Here are some examples for French (France):

That rule of "Go" over "GB" in French is also present in other locations using French as their official language, for instance Québec being on the top of my head. IIRC Romanian being close, it also abides by this rule.

The big exception to that whole rule would be Swiss French that uses GB, but coming from that part of the world myself, I think it would be better to use "Go" as it is more universally understood and common in this language.

On Monday, 29 January 2024 at 16:21, Tomas Mariancik @.***> wrote:

Can you provide more context for this? My assumption is that the storage units are generally universal and would go like kB, MB, GB, TB regardless of language.

Are you saying that different languages handle those sequences differently?

I'm not sure what would be the best approach here, because the actual unit is formatted externally based on the value. So we'd probably need to provide definitions for the common ones in the locale.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Frooxius commented 8 months ago

I see! Thanks for info! I think I know how we'd approach this - we'll define a list of keys in the locale for the units, so they can be optionally translated.

The formatter will then use those to provide the units there and then pass that localized substring as argument to the specific message.

Are there any other rules for these? Do they pluralize for example (e.g. "1 GB" would be "1 Go", but "2 GB" would be "2 Gos" or something like that)? Or are they pretty much 1:1 match to their normal versions?

jae1911 commented 8 months ago

Sounds good!

As far as I know, Go is just like GB and doesn't have any plurality to it (or at least haven't encountered that in 22 years). They should be 1:1 with GB, just the last letter changing due to the language.

On Monday, 29 January 2024 at 16:39, Tomas Mariancik @.***> wrote:

I see! Thanks for info! I think I know how we'd approach this - we'll define a list of keys in the locale for the units, so they can be optionally translated.

The formatter will then use those to provide the units there and then pass that localized substring as argument to the specific message.

Are there any other rules for these? Do they pluralize for example (e.g. "1 GB" would be "1 Go", but "2 GB" would be "2 Gos" or something like that)? Or are they pretty much 1:1 match to their normal versions?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Frooxius commented 8 months ago

Ok! I think I'll just pass it as a number anyways, so it'll be possible to plularize them in any case if needed, that would be the simplest.

Actually, would you mind creating an issue for this on the Resonite-Issues tracker?

jae1911 commented 8 months ago

Sure thing!

On Monday, 29 January 2024 at 19:00, Tomas Mariancik @.***> wrote:

Ok! I think I'll just pass it as a number anyways, so it'll be possible to plularize them in any case if needed, that would be the simplest.

Actually, would you mind creating an issue for this on the Resonite-Issues tracker?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>