After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 451858 - Notices strings for POT/PO files isn't localized
Notices strings for POT/PO files isn't localized
Status: RESOLVED FIXED
Product: damned-lies
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Claude Paroz
damned-lies Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2007-06-28 12:46 UTC by Diego Búrigo Zacarão
Modified: 2007-07-06 12:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adding deferred translation for notices (12.69 KB, patch)
2007-07-04 20:19 UTC, Claude Paroz
none Details | Review
Support of %s substitution (20.51 KB, patch)
2007-07-05 16:22 UTC, Claude Paroz
committed Details | Review

Description Diego Búrigo Zacarão 2007-06-28 12:46:11 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)
Comment 1 Claude Paroz 2007-07-04 20:19:53 UTC
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?
Comment 2 Claude Paroz 2007-07-05 16:22:43 UTC
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 :-)
Comment 3 Dimitris Glezos 2007-07-05 16:25:43 UTC
Claude, indeed, it seems pretty clean. Let's try it out.
Comment 4 Claude Paroz 2007-07-06 08:53:01 UTC
Committed in rev 408.
Comment 5 Diego Búrigo Zacarão 2007-07-06 12:04:19 UTC
Claude, Thank you!