GNOME Bugzilla – Bug 451858
Notices strings for POT/PO files isn't localized
Last modified: 2007-07-06 12:04:19 UTC
Would be great if notices strings for POT/PO files of damned-lies were translatable. Those strings are produced during the run of the update script and it isn't configured to be i18n-ized. Nowadays only the templates are translatable. Refer the following link for more information and screenshot of some strings: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=245756 (the problem number 2)
Created attachment 91205 [details] [review] Adding deferred translation for notices I have here a patch to add deferred translation of notices, that is they are still stored in English in the database, but only translated for display at runtime. The problem is that it's not working for strings containing %s style substitution, like "PO file '%s' is not UTF-8 encoded." % (myfile)", for the evident reason that at runtime the substitution has already be done, and gettext cannot match the corresponding translated string. One solution would be to store a marker in the string, like "PO file ##file.po## is not UTF-8 encoded.", and then add the magic in the gettext wrapper function, extracting the marked string (file.po), replacing ##file.po## by %s, extracting the translated string with normal gettext, and redoing string substitution (%s -> file.po). Do you see another "less hacking" solution?
Created attachment 91259 [details] [review] Support of %s substitution Here is the new patch with some corrections and the hack described in my previous comment, which wasn't as ugly to implement as I originally thought. If someone want to give a look before I commit it, you're welcome :-)
Claude, indeed, it seems pretty clean. Let's try it out.
Committed in rev 408.
Claude, Thank you!