GNOME Bugzilla – Bug 528015
no i18n of .policy files
Last modified: 2009-04-02 07:50:08 UTC
In 2.6.0, s-t-b does not have any i18n of PolicyKit .policy files. There should be .policy.in files, and intltool-merge should produce .policy files with translations. Alternatively, the .policy files need to specify a gettext translation domain, then the translation lookup can happen at runtime in policykit-gnome (similar to what Ubuntu already does with .desktop files, etc.) In either case, translatable strings should be xgettext'ed from the original English strings in .policy files, and be put into a PO template, so that they can be translated with the usual tools.
Any news about this bug? IMHO, this is a big i18n issue, because the "System policy prevents modifying the configuration" message shows many times when the user clicks on the Unlock button. The message is also very visible and is displayed with a very big font size. Please, take care of this.
I also would like to know the status of this issue.
Created attachment 127701 [details] [review] Patch adding i18n infrastructure to s-t-b .policy files Please find attached a patch with a bugfix to this issue. I have added intltool support in order to allow the strings in the .policy file to be extracted into the POT template. Please let me know whether there is more to be done in order to get the strings (once translators provide some PO files) to be shown translated on the desktop. Also, the POT file and the PO files should be added to l10n.gnome.org. Does a request need to be filed anywhere for that?
Fantastic, this looks good, thanks David.
A few comments: - I think with recent intlool versions you are not supposed to add the intltool-extract (and other scripts) to the project anymore - The .pot file is not supposed to be under version control - Why no-xml? - How are these strings actually used? There is no _() or gettext() call anywhere in the patch.
Wouter, Many thanks for the comments. First of all, I just wanted to mention that this is my first intltool-related patch and that my main problem has been to find some documentation (or up-to-date one) about its usage, especially with .policy files. The sources I have used are [1] and [2], the latter being quite complete but very much obsolete. This is not a complaint, but rather a justification for the patch not being quite there yet. >- I think with recent intlool versions you are not > supposed to add the intltool-extract (and other > scripts) to the project anymore I was just following what the most current intltool README [1] stated. I'll have to check this out. > - The .pot file is not supposed to be under version > control OK, I'll change this in the next version of the patch. > - Why no-xml? As the strings were extracted without trouble with [no-xml], I simply thought that the "extended xml parsing abilities provided by the XML::Parser" were not required. I can remove the [no-xml] if necessary, but I could not find much detailed information about when it is required, other than [1]. > - How are these strings actually used? There is no _() > or gettext() call anywhere in the patch. Here's where I was asking for advice on my original comment. I understand how the strings are extracted by intltool (by adding the underscores in the <message> tags in the .policy file), but I still can see how they make it from s-t-b to polkit-gnome. Some hint from a s-t-b developer or someone more knowledgeable might help me to get further. In the meantime, I'll try to find the location in the code where they are shown. [1] http://svn.gnome.org/viewvc/intltool/trunk/README?revision=738&view=markup [2] http://www.gnome.org/~malcolm/i18n/index.html
> How are these strings actually used? There is no _() or gettext() call anywhere in the patch. No need to. The strings aren't used by s-t-b or g-s-t themselves, but are presented by policykit-{gnome,kde}. I. e. the policy files just need to contain the translations, and the PK frontends will pick the right language according to the locale. Also, ack to not shipping static copies of intltool-*, GNOME recently stopped doing that (for good reasons, since that makes it impossible to provide bug fixes/new features to those). I don't know where this is documented either, though.
Created attachment 127718 [details] [review] Patch adding i18n infrastructure to s-t-b .policy files Reworked version of the patch addressing Wouter's and Martin's comments. Still pending: * Is [no-mxl] on IT_PROG_INTLTOOL needed? * making POT file available to l10n.gnome.org (through the freedesktop.org release set).
(In reply to comment #8) > Created an attachment (id=127718) [edit] > Patch adding i18n infrastructure to s-t-b .policy files > Reworked version of the patch addressing Wouter's and Martin's comments. Thanks for the much appreciated work, David. Let me go through the remaining issues: > Still pending: > * Is [no-mxl] on IT_PROG_INTLTOOL needed? Just drop it and don't specify anything. I've not seen any other Gnome module specify parameters before. > * making POT file available to l10n.gnome.org (through the freedesktop.org > release set). Try sending an e-mail to gnome-i18n@gnome.org. One minor remaining issue with your patch: please drop the "ca" line from po/LINGUAS. (Alternatively, provide a ca.po file, but I don't recommend bypassing translation teams, and a ca translation is not part of this bug either...) Thanks again!
Created attachment 127723 [details] [review] Patch adding i18n infrastructure to s-t-b .policy files Corrected the patch with Wouter's suggestions (thanks). > Try sending an e-mail to gnome-i18n@gnome.org. I will do. I'm familiar with the translation process, I am a GNOME translator myself, but I was simply asking in case there was a more formal process (e.g. filing bug) required to get the POT files from git.freedesktop.org to l10n.gnome.org. > One minor remaining issue with your patch: please drop the "ca" line > from po/LINGUAS. (Alternatively, provide a ca.po file, but I don't > recommend bypassing translation teams, and a ca translation is not > part of this bug either...) Yes, sorry. I had only used it for test purposes and my intention was to delete it, but somehow I failed to notice it was still there even after examining the patch. If there is anything remaining issue, please let me know and I'll change it.
Some more complaints: EXTRA_DIST = \ system-tools-backends-2.0.pc.in \ system-tools-backends.conf \ - system-tools-backends.policy \ + $(policy_in_files) $(policy_DATA) \ org.freedesktop.SystemToolsBackends.service.in \ test-backends.in \ diagnostics.pl \ I don't think it's a good idea to distribute $(policy_DATA), as this is intended to be generated at compile time. @@ -40,7 +40,8 @@ CLEANFILES = \ test-backends \ SystemToolsBackends.pl \ system-tools-backends-2.0.pc \ - org.freedesktop.SystemToolsBackends.service + org.freedesktop.SystemToolsBackends.service \ + system-tools-backends.policy.in I think "make clean" should remove the .policy file, not the policy.in :)
Created attachment 129291 [details] [review] Patch adding i18n infrastructure to s-t-b .policy files Corrected patch as per last comment.
Oh no... there is still something: + <description>Manage system configuration</description> + <description>Change user configuration</description> these should be marked for translation too, they are visible in the polkit-gnome-authorization application.
Created attachment 129301 [details] [review] Patch adding i18n infrastructure to s-t-b .policy files Patch corrected again. Now all messages in the .policy file are extracted for translation.
To make this a bit harder: g-s-t is unmaintained: http://blogs.gnome.org/carlosg/2008/02/01/two-new-children-in-cookieville/
I think that r-t members can approve committing changes that everyone agrees upon?
<vuntz> andre_: mail ddl? <vuntz> andre_: note that system-tools-backend is not hosted on gnome.org, but on fd.o, I think <vuntz> andre_: so... not everybody can commit there <vuntz> the patch itself might be okay <vuntz> not sure about some small changes
Comment on attachment 129301 [details] [review] Patch adding i18n infrastructure to s-t-b .policy files >@@ -40,7 +40,8 @@ CLEANFILES = \ > test-backends \ > SystemToolsBackends.pl \ > system-tools-backends-2.0.pc \ >- org.freedesktop.SystemToolsBackends.service >+ org.freedesktop.SystemToolsBackends.service \ >+ system-tools-backends.policy Should be $(policy_DATA), I guess. Else, it looks fine. Not sure who can commit this. s-t-b is hosted on fd.o, iirc...
Created attachment 129678 [details] [review] Patch adding i18n infrastructure to s-t-b .policy files Corrected patch as per last comment. >Else, it looks fine. Not sure who can commit this. s-t-b is hosted on fd.o, iirc... Yes, it is hosted at http://cgit.freedesktop.org/system-tools-backends/. Having had a look at the last commits, it seems that Carlos Garnacho did them.
Thanks a lot for the patch, looks great :). I've managed to move my butt and push it to the freedesktop repo.
Created attachment 131850 [details] [review] some translations from Rosetta Thanks for getting this in! Here is a patch which adds a broad range of translations, taken from Launchpad.
Hi Martin, I committed your patch, stripped from all the empty translations :-P Thanks.