Name entry in desktop file not localized

Bug #1420404 reported by Víctor R. Ruiz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Undecided
Unassigned
ubuntu-system-settings (Ubuntu)
Fix Released
High
Sebastien Bacher
ubuntu-system-settings (Ubuntu RTM)
Fix Released
High
Sebastien Bacher

Bug Description

In ubuntu-system-settings.desktop, the name entry is not translated.

[Desktop Entry]
Name=System Settings

ubuntu-system-settings:
  Installed: 0.3+15.04.20150204~rtm-0ubuntu1

current build number: 232
device name: krillin
channel: ubuntu-touch/ubuntu-rtm/14.09-proposed

Related branches

Víctor R. Ruiz (vrruiz)
summary: - Apps untranslated in Notifications
+ Name entry in desktop file not localized
Revision history for this message
Sebastien Bacher (seb128) wrote :

Confirmed, looking at the issue

Changed in ubuntu-system-settings (Ubuntu):
assignee: nobody → Sebastien Bacher (seb128)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Sebastien Bacher (seb128) wrote :

In fact that works on the desktop in unity7 and not under an unity8 session on the same machine. The code uses g_app_info_get_display_name() which is supposed to use gettext, the env looks similar (at least for LANGUAGE, LANG, LC_*), not sure what is different...

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

Ok, that was "fun" debugging, summmary of the issue

- g_app_info_get_display_name() calls g_dgettext()
- g_dgettext() decides on the translation strategy based on the return of the first call
- ubuntu-system-settings main.cpp calls initTr(I18N_DOMAIN, nullptr) with I18N_DOMAIN = "ubuntu-system-settings", so that's fine, but then when the MainView component is initialized, the domain is overwritten with the applicationName value, which is "SystemSettings"
- the first u-s-s call to g_dgettext() is made after that init, which has the wrong domain and leads to d_gettext() settling for "translations shouldn't be active there"

to add to the fun

- under unity7 the first call to g_dgettext() is made on start by external component providing desktop integration (theme, appmenu, ...), those calls success and enable translations, workarounding the previously described issues ... those components are not enabled under Mir though which explains why the bug seen only under unity8

In summary, changing applicationName to be "ubuntu-system-settings" (which is what the documentation suggests, it states that should = desktop name) should fix it, I'm submitting a fix for it

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

The issue I debugged, which is what Victor reported on IRC, is that the name doesn't show translated in the notifications panel. Since that got uses gappinfo to get the name it should get the translations through gettext. We might still need to unstrip the .desktop as well though because unity8 doesn't use gettext to get the display name iirc

Changed in ubuntu-system-settings (Ubuntu RTM):
importance: Undecided → High
assignee: nobody → Sebastien Bacher (seb128)
status: New → In Progress
Revision history for this message
Sebastien Bacher (seb128) wrote :

In fact it seems fine on the launcher and the start screen, assuming that the patch is enough then :-)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-system-settings - 0.3+15.04.20150213-0ubuntu1

---------------
ubuntu-system-settings (0.3+15.04.20150213-0ubuntu1) vivid; urgency=medium

  [ Sebastien Bacher ]
  * bluetooth: workaround for a bluez bug where the number of entered
    digits in DisplayPasskey pairing doesn't make sense. Only update the
    passkey hint while typing if the number is <= 6.
  * change applicationName MainView's property to be "ubuntu-system-
    settings" rather than "SystemSettings", the documentation says it
    should match the desktop file name. The toolkit also sets the
    textdomain to that value which leads to translation issues, even if
    the domain is changed again later on, since glib does some init
    based on the return value of the first call to g_dgettext for
    example (LP: #1420404)
 -- CI Train Bot <email address hidden> Fri, 13 Feb 2015 18:43:07 +0000

Changed in ubuntu-system-settings (Ubuntu):
status: In Progress → Fix Released
Changed in canonical-devices-system-image:
status: New → Fix Released
Changed in ubuntu-system-settings (Ubuntu RTM):
status: In Progress → Fix Released
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.