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

Add a way to localise units in different languages #186

Open
jae1911 opened this issue Jan 29, 2024 · 6 comments
Open

Add a way to localise units in different languages #186

jae1911 opened this issue Jan 29, 2024 · 6 comments

Comments

@jae1911
Copy link
Contributor

jae1911 commented Jan 29, 2024

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
Copy link
Member

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
Copy link
Contributor Author

jae1911 commented Jan 29, 2024 via email

@Frooxius
Copy link
Member

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
Copy link
Contributor Author

jae1911 commented Jan 29, 2024 via email

@Frooxius
Copy link
Member

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
Copy link
Contributor Author

jae1911 commented Jan 29, 2024 via email

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

2 participants