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 528015 - no i18n of .policy files
no i18n of .policy files
Status: RESOLVED FIXED
Product: gnome-system-tools
Classification: Deprecated
Component: s-t-b
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Carlos Garnacho
Depends on:
Blocks:
 
 
Reported: 2008-04-14 11:55 UTC by Martin Pitt
Modified: 2009-04-02 07:50 UTC
See Also:
GNOME target: 2.26.x
GNOME version: 2.21/2.22


Attachments
Patch adding i18n infrastructure to s-t-b .policy files (7.12 KB, patch)
2009-02-01 15:00 UTC, David Planella
reviewed Details | Review
Patch adding i18n infrastructure to s-t-b .policy files (5.78 KB, patch)
2009-02-01 19:08 UTC, David Planella
reviewed Details | Review
Patch adding i18n infrastructure to s-t-b .policy files (5.77 KB, patch)
2009-02-01 21:46 UTC, David Planella
none Details | Review
Patch adding i18n infrastructure to s-t-b .policy files (5.75 KB, patch)
2009-02-22 23:29 UTC, David Planella
none Details | Review
Patch adding i18n infrastructure to s-t-b .policy files (5.75 KB, patch)
2009-02-23 07:44 UTC, David Planella
none Details | Review
Patch adding i18n infrastructure to s-t-b .policy files (5.74 KB, patch)
2009-02-27 18:20 UTC, David Planella
committed Details | Review
some translations from Rosetta (106.15 KB, patch)
2009-04-01 17:28 UTC, Martin Pitt
committed Details | Review

Description Martin Pitt 2008-04-14 11:55:30 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.
Comment 1 Ricardo Perez 2008-11-28 10:22:40 UTC
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.
Comment 2 Tomasz Dominikowski 2008-12-03 14:56:24 UTC
I also would like to know the status of this issue.
Comment 3 David Planella 2009-02-01 15:00:38 UTC
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?
Comment 4 Tomasz Dominikowski 2009-02-01 15:09:28 UTC
Fantastic, this looks good, thanks David.
Comment 5 Wouter Bolsterlee (uws) 2009-02-01 16:00:15 UTC
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.
Comment 6 David Planella 2009-02-01 16:46:10 UTC
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
Comment 7 Martin Pitt 2009-02-01 18:42:11 UTC
> 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.
Comment 8 David Planella 2009-02-01 19:08:08 UTC
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).
Comment 9 Wouter Bolsterlee (uws) 2009-02-01 20:07:30 UTC
(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!
Comment 10 David Planella 2009-02-01 21:46:06 UTC
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.
Comment 11 Gabor Kelemen 2009-02-22 11:52:00 UTC
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 :)
Comment 12 David Planella 2009-02-22 23:29:02 UTC
Created attachment 129291 [details] [review]
Patch adding i18n infrastructure to s-t-b .policy files

Corrected patch as per last comment.
Comment 13 Gabor Kelemen 2009-02-23 01:27:30 UTC
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.
Comment 14 David Planella 2009-02-23 07:44:01 UTC
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.
Comment 15 André Klapper 2009-02-24 19:16:12 UTC
To make this a bit harder:
g-s-t is unmaintained:
http://blogs.gnome.org/carlosg/2008/02/01/two-new-children-in-cookieville/
Comment 16 Wouter Bolsterlee (uws) 2009-02-24 21:23:59 UTC
I think that r-t members can approve committing changes that everyone agrees upon?
Comment 17 André Klapper 2009-02-27 17:05:18 UTC
<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 18 Vincent Untz 2009-02-27 17:18:38 UTC
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...
Comment 19 David Planella 2009-02-27 18:20:17 UTC
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.
Comment 20 Carlos Garnacho 2009-03-17 02:21:02 UTC
Thanks a lot for the patch, looks great :). I've managed to move my butt and push it to the freedesktop repo.
Comment 21 Martin Pitt 2009-04-01 17:28:45 UTC
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.
Comment 22 Claude Paroz 2009-04-02 07:50:08 UTC
Hi Martin,

I committed your patch, stripped from all the empty translations :-P Thanks.