Polkit dialogs of snapd are not translatable

Bug #1747272 reported by AsciiWolf
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Translations
Fix Released
Undecided
Unassigned
snapd (Ubuntu)
Fix Released
Medium
Gunnar Hjalmarsson

Bug Description

The polkit dialogs shown during snap installation/removal cannot be translated using Launchpad and are untranslated on non-English Ubuntu install. See the attached screenshot. Please, make the dialogs translatable.

Tags: l10n patch
Revision history for this message
AsciiWolf (asciiwolf) wrote :
Revision history for this message
John Lenton (chipaca) wrote :

How do other polkit-using projects do the translation?

Revision history for this message
AsciiWolf (asciiwolf) wrote :

Sorry, I don't know. Maybe someone from the Canonical desktop team will have more info about this.

Revision history for this message
AsciiWolf (asciiwolf) wrote :

For example Gufw (GUI for UFW firewall) has this in the polkit xml file:
<message gettext-domain="gufw">Authentication is required to run the Firewall Configuration</message>

Revision history for this message
AsciiWolf (asciiwolf) wrote :

The xml file should be also probably added to something like POTFILES.in. (Or maybe not, I am not an expert on Launchpad.)

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

I would think that the attached patch is what's needed to fix this.

Caveat: This is untested. The regular xgettext() would extract those .policy file strings fine, but I don't know if xgettext-go() does. If not, a slightly different solution is needed.

Changed in snapd (Ubuntu):
assignee: nobody → Gunnar Hjalmarsson (gunnarhj)
importance: Undecided → Medium
status: New → In Progress
tags: added: patch
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Submitting a second variant which makes use of xgettext(), but also this one is basically untested. I simply don't know how to build the thing. :(

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

xgettext() needs an applicable "rule" file to be able to extract strings from .policy files. The smoothest way to achieve that is to include policykit-1 in Build-Depends (not there currently AFAIK). policykit-1 provides /usr/share/gettext/its/polkit.{its,loc}.

Revision history for this message
AsciiWolf (asciiwolf) wrote :

Thanks for your great work! Feel free to let me know if you need help with something (testing etc.).

Revision history for this message
Sebastien Bacher (seb128) wrote :

Gunnar, do you think you could put a pull request on github for that change? That's where the snappy team is doing reviews, https://github.com/snapcore/snapd (feel free to ask on IRC if you need help with git or github)

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

@AsciiWolf: Second thoughts on your note here:

https://github.com/snapcore/snapd/pull/4723#issuecomment-369923663

Are there actually so many new translations in the upstream source to be imported? I see that the template in LP is dated 2018-02-20, which is fine.

Revision history for this message
AsciiWolf (asciiwolf) wrote :

As noted in the GitHub PR: It looks like that the translation sync with Launchpad is broken and the actual translations were last updated 5 months ago.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

I digged a bit more about importing translations, and AFAICT it's a non-issue. Reason: LP *is* upstream. The .po files in upstream git consist of exported files from LP, and the latest sync happened last October.

https://github.com/snapcore/snapd/pull/4053/commits/f884b3ba

Revision history for this message
AsciiWolf (asciiwolf) wrote :

Ah, thanks for clarifying this. By the way, I see that the commits from your PR were merged only to the master branch, not to the 2.31 or 2.32 branches. Is this ok? I hope that the translated strings will be available in Ubuntu 18.04.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Don't know. I have assumed/hoped that 2.32 including those commits will make it into Ubuntu before the 18.04 release.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Sebastien let me know that a separate 2.32 PR is needed, so here it is:

https://github.com/snapcore/snapd/pull/4855

Revision history for this message
AsciiWolf (asciiwolf) wrote :

The snapd-2.32+18.04~pre5 package is now available in Ubuntu 18.04, but it looks like the polkit strings are still not available for translation on Launchpad. :-(

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

This was finally fixed through the build of snapd 2.32+18.04.

Changed in snapd (Ubuntu):
status: In Progress → Fix Released
Changed in ubuntu-translations:
status: New → Fix Released
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

New issue, though - bug #1758684

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.