elementary / applications-menu

Applications Menu for elementary OS and the Pantheon desktop environment
https://elementary.io
GNU General Public License v3.0
104 stars 35 forks source link

Translate SI units and prefixes #553

Closed jeremypw closed 1 month ago

jeremypw commented 1 year ago

Fixes #552

Rather than using the context translation function NC_() to mark array initialisers as translatable (which does not seem to result in any new entries in the .po files for some reason), the more usual N_() function is used and the context provided with TRANSLATOR comments.

Missing translation functions on the output are provided. The possibility of translating the SI prefixes is also implemented.

tintou commented 1 year ago

I really feel that this should be reworked to take into account two things for i18n:

jeremypw commented 1 year ago

One can't assume that every language will do a "$PREFIX$UNIT"

Do you mean that some languages will have "$UNIT$PREFIX"? That can be handled by the translation can't it? If you mean some languages will have a completely different single word for e.g. "centimeter" then that is a harder problem. We cannot really provide separate translations for all possible combinations.

One has to take plural into account and use ngettext()

The information in brackets "( to ) is intentionally unpluralized as it is not intended to be a sentence. It is there to disambiguate some cases where there is more than one possible interpretation of the entry and more than one result is given. Pluralizing would also extend the scope of this PR as it is not pluralized in master. Maybe it would be better to replace "to" with a untranslated symbol "=>" to make it clear it is not a sentence?

jeremypw commented 1 month ago

Closing as outdated and stalled.