Axel Hecht Mozilla in Your Language

April 8, 2010

New version of compare-locales released, please update

Filed under: L10n,Mozilla — Tags: , — Axel Hecht @ 4:29 pm

I’ve released a new version of compare-locales, and you should really update.

The new version of compare-locales adds:

  • support for more than one filter.py
  • support for filter.py returning more than just bools, but “error”, “report”, or “ignore”.

Why?

Lorentz strings. They are missing, but them missing isn’t fatal. So we needed a third state.
And some of them are in toolkit, so we’re moving parts of the filter.py logic from all over the place into
releases/mozilla-1.9.2/toolkit/locales/filter.py. That means that we can remove the hacks in comm-central and mobile-browser, making our life so much more reliable and predictable.

The changes to 1.9.2 will land shortly, so versions of compare-locales prior to 0.7 will stop working.

Update paths:

easy_install -U compare-locales
is the easiest way to do it. Depending on OS and local settings, you might want to
sudo easy_install -U compare-locales

Or,
hg clone http://hg.mozilla.org/build/compare-locales/
and do whatever you did last time, setting paths or python setup.py install.

How does it look? Where’s beef? Or veggies?

Here’s what 0.8 spits out for German on 1.9.2 with patched filter.py:

de
   browser/chrome/browser
     browser.properties
         +crashedpluginsMessage.learnMore
         +crashedpluginsMessage.reloadButton.accesskey
         +crashedpluginsMessage.reloadButton.label
         +crashedpluginsMessage.submitButton.accesskey
         +crashedpluginsMessage.submitButton.label
         +crashedpluginsMessage.title
     preferences/advanced.dtd
         +submitCrashes.accesskey
         +submitCrashes.label
   toolkit/chrome/mozapps/plugins/plugins.dtd
       +reloadPlugin.middle
       +reloadPlugin.post
       +reloadPlugin.pre
       +report.disabled
       +report.failed
       +report.please
       +report.submitted
       +report.submitting
       +report.unavailable
de:
keys: 940
report: 17
unchanged: 634
changed: 4561
87% of entries changed

You can see the regular output of missing strings, and you’ll recognize all of lorentz. New here are three things:

The strings in the long display are not counted as missing, but are in a new summary item called “report”. Those strings are not fatal, but should get localized.
The return value of compare-locales is only dependent on *missing* strings, i.e., code checking the return value will see a successful run of compare-locales if there are reported strings, as long as there are none missing.
If you switch l10n-merge on, it won’t merge the reported strings, but rely on the real code falling back as intended.

Not-so-important feature update, compare-dirs is now supporting l10n-merge, too. That’s sweet for the upcoming weave stuff.

Questions are welcome here, bug reports are welcome in “Mozilla
Localizations”, “Infrastructure” component
.

7 Comments

  1. I haven’t been following Lorentz l10n/i18n at all; how are potentially missing strings handled? Will the user rely solely on graphical feedback? Are English-only strings shown (ugh)? Or is it something else that I just haven’t thought of?

    Comment by Jeff Walden — April 8, 2010 @ 10:34 pm

  2. The code picks up existing strings from localizations, but has hard-coded fallback strings to English, you can take a look at the magic changeset.

    So if a localizer has those strings, they’ll be shown, otherwise it’s English.

    This is not only the smoothest path for getting this localized that we came up with, it also keeps language packs in the wild compat with 3.6.*.

    Comment by Axel Hecht — April 9, 2010 @ 2:16 am

  3. I’m getting this error whe trying to install with pip:

    pip install –install-option=–user -U compare-locales:
    Downloading/unpacking compare-locales
    Downloading compare-locales-0.6.1.tar.gz
    Running setup.py egg_info for package compare-locales
    Traceback (most recent call last):

    File “/home/damjan/build/compare-locales/setup.py”, line 13, in

    import ez_setup

    ImportError: No module named ez_setup

    Comment by Damjan — April 11, 2010 @ 3:45 pm

  4. Hrm. Didn’t check pip, only easy_install.

    0.6.1 is clearly the wrong version, too. Which version of python are you using?

    Comment by Axel Hecht — April 12, 2010 @ 1:58 am

  5. typo:

    sudo easy_install -u compare-locales

    should have -U (CAPS)

    Comment by Brian King — April 12, 2010 @ 10:22 am

  6. Fixed, thanks.

    Comment by Axel Hecht — April 12, 2010 @ 12:07 pm

  7. I released an updated version 0.8.1 now, with a bustage fix for windows, and hopefully pip-compatible.

    Comment by Axel Hecht — April 13, 2010 @ 4:02 am

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress