Polkit dialogs of snapd are not translatable

Bug #1747272 reported by AsciiWolf on 2018-02-04
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Translations
snapd (Ubuntu)
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.

AsciiWolf (asciiwolf) wrote :
John Lenton (chipaca) wrote :

How do other polkit-using projects do the translation?

AsciiWolf (asciiwolf) wrote :

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

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>

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.)

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
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. :(

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}.

AsciiWolf (asciiwolf) wrote :

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

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)

Gunnar Hjalmarsson (gunnarhj) wrote :

@AsciiWolf: Second thoughts on your note here:


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.

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.

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.


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.

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.

Gunnar Hjalmarsson (gunnarhj) wrote :

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


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. :-(

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

Other bug subscribers

Bug attachments