GNOME Bugzilla – Bug 786704
Can’t switch the currency order
Last modified: 2018-01-03 17:06:31 UTC
This: #: lib/gs-price.c:129 #, c-format msgid "%s %f" msgstr "%f %s" produces this: $ msgfmt -cvo /dev/null po/pl.po po/pl.po:2124: format specifications in 'msgid' and 'msgstr' for argument 1 are not the same msgfmt: found 1 fatal error Obviously, many languages prefer “12 USD” to “USD 12”.
What's the proper way to fix this? Thanks.
I don’t know about “proper”, but here is the same thing in gnome-calculator that doesn’t trip over gettext: https://git.gnome.org/browse/gnome-calculator/tree/lib/unit.vala#n125
The proper way to fix this is to use positional parameters in the translation, e.g.: msgstr "%2$f %1$s" See the gettext manual for more info.
Also, %f is not the right way to print a fractional price. See the glibc documentation on 'struct lconv' for more information.
Created attachment 364942 [details] [review] lib: Add a comment for translators Explaining how you can switch the currency order to your locale’s convention.
Don't we also want to use NC_? "%s %f" isn't super-useful, and I can see it being used elsewhere. As usual, not the expert here.
I can’t find another %f in <https://l10n.gnome.org/POT/gnome-software.master/gnome-software.master.pot>, so there is nothing to disambiguate it from (C_). I can’t tell if N_ is needed — that’s a coding issue.
Comment on attachment 364942 [details] [review] lib: Add a comment for translators Pushed, we can always improve it later. https://git.gnome.org/browse/gnome-software/commit/?id=71b6476a4827bf45be3e3eedd6b29b8133214e8e