GNOME Bugzilla – Bug 791648
Consider using positional specifier in genitive construction
Last modified: 2017-12-16 17:28:45 UTC
#: lib/ephy-sync-utils.c:326 msgid "%s’s GNOME Web on %s" This does not translate well. Not all languages will have the strings in the same order when using a genitive construction. According to https://stackoverflow.com/questions/2459390/localizing-concatenated-or-dynamic-strings we can use positional specifiers, so "%1$s's GNOME Web on %2$s" so we could translate it with the strings in the reverse order. Would this be possible?
Yeah, sure.
Created attachment 365601 [details] [review] sync-utils: Extend the translator comment to cover switching variables
Review of attachment 365601 [details] [review]: What could possibly go wrong :)
(BTW, Saxon genitive is problematic anyway: https://bugzilla.gnome.org/show_bug.cgi?id=767107#c1).
Comment on attachment 365601 [details] [review] sync-utils: Extend the translator comment to cover switching variables Thanks, pushed: https://git.gnome.org/browse/epiphany/commit/?id=db7a7389b33dcd7715694e25fbfd2ff274add14e In case you’re wondering, msgfmt should report an error if the variables are malformed.
(In reply to Piotr Drąg from comment #5) > In case you’re wondering, msgfmt should report an error if the variables are > malformed. I don't think it's smart enough to detect when the format string is no longer compatible with the original... we have had language-specific crashes before that turned out to be caused by translators accidentally changing format strings. :/
$ cat po/pl.po |grep '$s' msgstr "Przeglądarka WWW środowiska GNOME użytkownika %3$s na komputerze %4$s" $ msgfmt -cvo /dev/null po/pl.po po/pl.po:1647: 'msgstr' is not a valid C format string, unlike 'msgid'. Reason: The string refers to argument number 3 but ignores argument number 1. msgfmt: found 1 fatal error 697 translated messages. $ cat po/pl.po |grep '$s' msgstr "Przeglądarka WWW środowiska GNOME użytkownika %$2s na komputerze %1$s" $ msgfmt -cvo /dev/null po/pl.po po/pl.po:1647: 'msgstr' is not a valid C format string, unlike 'msgid'. Reason: In the directive number 1, the character '$' is not a valid conversion specifier. msgfmt: found 1 fatal error 697 translated messages. It seems smart enough. Perhaps you were using non-standard variables (like Nautilus used to have %B and %V), or some erroneous translations got in when msgfmt hook was temporarily broken a few years back?