Bug 98366 - Default to "no" for translations
Summary: Default to "no" for translations
Status: RESOLVED FIXED
Alias: None
Product: PolicyKit
Classification: Unclassified
Component: daemon (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact: David Zeuthen (not reading bugmail)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-21 00:38 UTC by Peter Hutterer
Modified: 2016-11-08 21:05 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
gettext: switch to default-translate "no" (1.53 KB, patch)
2016-11-01 07:34 UTC, Ondrej Holy
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Hutterer 2016-10-21 00:38:52 UTC
Coming from https://bugzilla.gnome.org/show_bug.cgi?id=768707

gvfs switched to gettext which appears to translate everything by default (as opposed to the previous intltool-merge). gvfs ships with a copy of polkit.its and that's not ready for this change that. It needs the diff below to switch to translation off by default, and then re-enables the two tags we want translated. It also changes the paths for those, since <action> isn't the root node they have no effect otherwise.

diff --git a/data/polkit.its b/data/polkit.its
index 1312ecb..7eeffc5 100644
--- a/data/polkit.its
+++ b/data/polkit.its
@@ -1,7 +1,8 @@
 <?xml version="1.0"?>
 <its:rules xmlns:its="http://www.w3.org/2005/11/its"
            version="2.0">
-  <its:translateRule selector="/action/description |
-                               /action/message"
+  <its:translateRule selector="//*" translate="no" />
+  <its:translateRule selector="//action/description |
+                               //action/message"
                      translate="yes"/>
 </its:rules>

If you're happy with this, I'll get a proper patch done.
Comment 1 Miloslav Trmac 2016-10-31 15:02:31 UTC
ACK, this makes sense.  (https://www.w3.org/TR/its20/#basic-concepts-overinher : The ITS default is that all elements are translatable. )
Comment 2 Ondrej Holy 2016-11-01 07:34:03 UTC
Created attachment 127658 [details] [review]
gettext: switch to default-translate "no"

The default appears to be to translate all entries. This rule never takes
effect, the path to /action/message and /action/description is wrong (/action
is not a root node). Since we wanted them to be translated, it doesn't matter.

But it also translates all other tags (vendor, allow_any, etc.) and that
causes polkit to be unhappy, it can't handle the various language versions of
"no"

** (polkitd:27434): WARNING **: Unknown PolkitImplicitAuthorization string
'tidak'

Switch to a default of "no" and explicitly include the message and description
strings to be translated.

The patch was modified for PolicyKit by Ondrej Holy <oholy@redhat.com>.
Comment 3 Miloslav Trmac 2016-11-08 21:05:20 UTC
Applied, thanks!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.