Help improving webapps' i18n support

David Planella david.planella at
Sun Nov 4 12:18:10 UTC 2012

Hi translators,

A fix for webapps to display the Firefox prompts in the user's locale
has just been uploaded to the quantal-proposed repository.

In order for this fix to be shipped to all users, it needs to be
verified. I would like to ask you to help with testing and verifying
it's been fixed in as many languages as possible.

I should not take more than a few minutes to follow these steps:

1. Enable the quantal-proposed repository in Software Sources
2. sudo apt-get update
3. sudo apt-get install unity-webapps-common
4. Restart Firefox
5. Open a site with webapp support (e.g. Gmail)
6. Verify that the message on the quicklist for the Launcher icon
   is localized
7. Leave the feedback on the bug and change the verification-needed tag.

If this package fixes the bug for you, please change the bug tag from
verification-needed to verification-done.  If it does not, change the
tag to verification-failed.

For more details, see the original bug report text below.



-------- Missatge original --------
Assumpte: [Bug 1065422] Re: Language detection code will not work for
all languages
Data: Sun, 04 Nov 2012 01:59:15 -0000
De: Steve Langasek <steve.langasek at>
Respon a: Bug 1065422 <1065422 at>
A: david.planella at

Hello David, or anyone else affected,

Accepted webapps-applications into quantal-proposed. The package will
build now and be available at
/webapps-applications/2.4.10-0ubuntu1 in a few hours, and then in the
-proposed repository.

Please help us by testing this new package.  See for documentation how to
enable and use -proposed.  Your feedback will aid us getting this update
out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from
verification-needed to verification-done.  If it does not, change the
tag to verification-failed.  In either case, details of your testing
will help us make a better decision.

Further information regarding the verification process can be found at .  Thank you in

** Changed in: webapps-applications (Ubuntu Quantal)
       Status: New => Fix Committed

** Tags added: verification-needed

You received this bug notification because you are subscribed to the bug

  Language detection code will not work for all languages

Status in Ubuntu Translations:
  Fix Committed
Status in WebApps: Initial set of Apps:
  Fix Committed
Status in “webapps-applications” package in Ubuntu:
Status in “webapps-applications” source package in Quantal:
  Fix Committed

Bug description:
  Language detection code will not work for some languages

  1. LC_ALL=zn_CN.UTF8 firefox
  2. open gmail
  action's name in launcher should be localized

  [Regression Potential]

  Currently the code to detect the user's language preference to load
  the translations for webapps is the following (in common/utils.js):

      var lang = unsafeWindow.navigator.language; //TODO: came up with a
  better approach

      if (dict.hasOwnProperty(lang) && dict[lang].hasOwnProperty(strid)) {
          return dict[lang][strid];
      } else {
          return strid;

  'dict' is a variable containing a JSON string that is populated at
  build time with the contents of the translations in .po files in the
  source tree. It includes the locale code as read from the .po (or
  LINGUAS) files, which is a gettext-style locale code.

  The problem is that the 'lang' variable as returned from the browser
  in some cases won't match the user's locale. This is mainly due to the
  fact that Firefox uses IETF-style language codes, whereas the system
  uses gettext-style language codes. That means for some languages there
  won't be a match, and thus translations won't be loaded. Here's an
  example for Simplified Chinese:

  - Gettext locale code: zh_CN
  - Firefox locale code: zh-cn

  So there must be a translation gettext -> Firefox (and Chromium, if it
  returns locales in a different format) at build time, so that locale
  names from the system and from the browser can match and translations
  can be loaded.

  Also notice that in some cases either the country code in the locale
  code might be present in the system locale but not in the browser, and
  viceversa, so it might be an idea to ignore the country code apart
  from some exceptions (e.g. zh_CN and zh_TW, pt_BR, etc., to name a

To manage notifications about this bug go to:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 551 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the ubuntu-translators mailing list