Set up the translation domain automatically for click packages

Bug #1233071 reported by David Planella
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu UI Toolkit
Fix Released
Undecided
Cris Dywan
ubuntu-ui-toolkit (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Right now, the i18n plugin is initialized automatically for QML apps in the sense that i18n.domain is set to the name of the app and i18n.textdomain is set to /usr/share/locale. This way developers can start using the i18n system straight away without having to worry to initialize it (which they can nevertheless do, if they want to override the default settings).

However, with click packages the i18n.textdomain assumption does no longer hold true, as the translations will not be installed in the system locations.

For click packages, i18n.textdomain should be set to @{CLICK_DIR}/@{APP_PKGNAME}/@{APP_VERSION}/locale instead of /usr/share/locale

Note: the last statement should be double-checked with the security team. The requirement for gettext to work is that the folder hierarchy under locale/ stays the same as the layout in /usr/share/locale, but the prefix can be any specified as i18n.textdomain.

Related branches

David Planella (dpm)
tags: added: i18n
Cris Dywan (kalikiana)
tags: added: application-confinement
David Planella (dpm)
description: updated
description: updated
David Planella (dpm)
description: updated
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

@{CLICK_DIR}/@{APP_PKGNAME}/@{APP_VERSION} corresponds to the install directory of the click app, so using @{CLICK_DIR}/@{APP_PKGNAME}/@{APP_VERSION}/locale is just fine from a security POV and wrt apparmor policy.

That said, upstream click has been clear that people should not hard code paths to the @{CLICK_DIR} because @{CLICK_DIR} is configurable and subject to change. I'm not sure what the solution is-- though I can say that both upstart-app-launch and aa-exec-click will chdir to the install directory (the Path= in the .desktop file), so perhaps a relative path can be used instead. I suggest talking to the click team for input.

Revision history for this message
Sergio Schvezov (sergiusens) wrote : Re: [Bug 1233071] Re: Set up the translation domain automatically for click packages

On Thu, Oct 10, 2013 at 3:21 PM, Jamie Strandboge <email address hidden> wrote:

> @{CLICK_DIR}/@{APP_PKGNAME}/@{APP_VERSION} corresponds to the install
> directory of the click app, so using
> @{CLICK_DIR}/@{APP_PKGNAME}/@{APP_VERSION}/locale is just fine from a
> security POV and wrt apparmor policy.
>
> That said, upstream click has been clear that people should not hard
> code paths to the @{CLICK_DIR} because @{CLICK_DIR} is configurable and
> subject to change. I'm not sure what the solution is-- though I can say
> that both upstart-app-launch and aa-exec-click will chdir to the install
> directory (the Path= in the .desktop file), so perhaps a relative path
> can be used instead. I suggest talking to the click team for input.
>

I like where this is going; this could be provided by a system hook for the
application and it would install the locales in a writable location with
the added benefit of having unity8 scan only one location too and would
find the translations for the desktop files.

Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit:
assignee: nobody → Christian Dywan (kalikiana)
status: New → In Progress
summary: - Set up the translation domain automatically for click packages
+ 设置自动翻译域点击包
Cris Dywan (kalikiana)
summary: - 设置自动翻译域点击包
+ Set up the translation domain automatically for click packages
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:ubuntu-ui-toolkit at revision 816, scheduled for release in ubuntu-ui-toolkit, milestone Unknown

Changed in ubuntu-ui-toolkit:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.2 KiB)

This bug was fixed in the package ubuntu-ui-toolkit - 0.1.46+14.04.20131105.1-0ubuntu1

---------------
ubuntu-ui-toolkit (0.1.46+14.04.20131105.1-0ubuntu1) trusty; urgency=low

  [ Albert Astals ]
  * Minor optimzations Add const & to foreach to save copies of
    "complex" types Remove initializations of QStrings to "" since they
    do nothing Return QString instead of "" since its faster Pass
    "complex" types as const & instead of copy to functions Not an
    optimization: Added const qualifier to two functions .

  [ Lars Uebernickel ]
  * Remove GIconProvider Use urls for file and data icons and the theme
    image provider (image://theme/) for themed icons.

  [ Kaleo ]
  * [visual design] Updated tabs chevron asset.

  [ Christian Dywan ]
  * Install translations for UI toolkit and gallery. (LP: #1239627)
  * Support checkbox used with an action.
  * Install autopilot modules in qmake not debian packaging.
  * Drop the $$ from system calls where output isn't needed.
  * Look for locale folder as per XDG basedir spec and rewrite test The
    new test case covers the whole range of changing languages, checking
    the strings from both QML and C++ and binding to a folder. (LP:
    #1175726, #1233071)
  * Define window within OrientationHelper to avoid a race condition.
    (LP: #1239760)

  [ Zsombor Egri ]
  * Support for taking themes from XDG_DATA_DIRS as well as from
    ~/.local/share. These paths are also added as import paths.
    UBUNTU_UI_TOOLKIT_THEMES_PATH overrules these import paths, and can
    have more than one path specified, each separated with column. (LP:
    #1221813)
  * Warnings treated as errors in all types of builds (debug or
    release). (LP: #1246290)
  * Introducing topmostItem property to drive whether InverseMouseArea
    should filter sensingArea events or to stay in the normal z-
    order/stack order of its parent. (LP: #1240460)

  [ Leo Arias ]
  * Added the go back method to the autopilot emulators. (LP: #1239751)
  * On the autopilot emulator, drag the toolbar to its full height. (LP:
    #1235060)
  * Initially show toolbar, but automatically hide after timeout. (LP:
    #1207369)
  * Added the change_state method to the CheckBox autopilot emulator.
    Cleaned up the autopilot gallery toggles tests.
  * Added the objectNames to the ComposerSheet buttons. (LP: #1244518)

  [ tpeeters ]
  * Update CrossFadeImage API so that sourceSize can be set by the
    applications. CHANGED in CrossFadeImage: readonly property size
    sourceSize TO property size sourceSize. (LP: #1227783)
  * Initially show toolbar, but automatically hide after timeout. (LP:
    #1207369)
  * Put tab bar in selection mode when apps are launched. (LP: #1223597)
  * Close tabbar and toolbar when user interacts with app contents. (LP:
    #1223604)

  [ Nicolas d'Offay ]
  * Added multiSelection bool and supporting code to OptionSelector and
    ItemSelector. This turns either component into a multiple choice
    selector. Fixed linked bugs. (LP: #1231936)

  [ Renato Araujo Oliveira Filho ]
  * Implemented emulator for swipe to remove. (LP: #1236464)

  [ Ubuntu daily release ]
  * Automatic snapshot from revision 820
 -- Ubu...

Read more...

Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Fix Released
Revision history for this message
Chris Wayne (cwayne) wrote :

Click packages still don't seem to be translated with trusty r15

Revision history for this message
Cris Dywan (kalikiana) wrote :

See bug 1250546 for the follow-up investigation.

Revision history for this message
David Planella (dpm) wrote :

This was fixed at some point, and it's worked well for a while, but we've regressed and I've thus opened a follow up bug 1317772

Changed in ubuntu-ui-toolkit:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

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