Closed quozl closed 6 years ago
@quozl The game updates the scores. So in some other language(for example: Chinese) the integer must be different looking character so it needs to go through gettext
Isn't that a job for a character set?
@quozl I am bit doubtful about that. We should consult this with @leonardcj
I need to look a little more closely at the correct way to ensure proper L10n into non-Arabic numerals. I will get back to you on this.
@leonardcj, thanks.
@leonardcj, any news?
Um, I thought there was a %(num)Id type for internationalizing the numerals as opposed to %(num)d. Maybe I was thinking of http://wiki.laptop.org/go/Python_i18n#Some_tips where it mentions "Python 2.6 and 3.0 support new formatting options, including a "%n" localized number format."
Okay. @iamutkarshtiwari, what do you think?
Problem is that a POT
file and po/en.po
file cannot practically contain every possible number that might be used as a player score, so _(str(int))
may never work; always returning str(int)
unchanged.
https://www.gnu.org/software/gettext/manual/gettext.html
As a special feature for Farsi (Persian) and maybe Arabic, translators can insert an ‘I’ flag into numeric format directives. For example, the translation of "%d" can be "%Id". The effect of this flag, on systems with GNU libc, is that in the output, the ASCII digits are replaced with the ‘outdigits’ defined in the LC_CTYPE locale category. On other systems, the gettext function removes this flag, so that it has no effect.
Note that the programmer should not put this flag into the untranslated string. (Putting the ‘I’ format directive flag into an msgid string would lead to undefined behaviour on platforms without glibc when NLS is disabled.)
Does that make more sense?
Thanks!
In bb7634990ab6db7a6a9c086eb6f3d043fcf7fc92 and 44a263fe1aaa40c2b8254bc5f4fb633c66420eb2 you add gettext for integers.
@leonardcj, is this valid use?