Axel Hecht Mozilla in Your Language

June 24, 2010

Localizing Lorentz

Filed under: L10n,Mozilla — Tags: , — Axel Hecht @ 7:20 am

It’s been a while, but I’ll take a stab at what we did to localize Lorentz, i.e., how did we add strings to a stable branch?

The underlying principle was add-on compatibility, that is, language packs that are out there and compatible with 3.6.* needed to continue to work. The second principle was that while we didn’t want to break existing language packs, we did want to offer our localizers to work on the new strings to get the best possible user experience. So we’re adding strings without adding strings.

Given that we had a project branch for Lorentz, the work on the Lorentz branch itself was rather simple, just code like you’d always do. We didn’t do any special branch mechanics there, and built the Lorentz branch against the regular l10n repositories on 1.9.2. The only caveat here was to not remove strings, only additions were OK. As soon as that work got stable in terms of the strings used, we landed a patch that, for each new string, adds a hard-coded fallback to the code. That way, you pick up the localized string without failing if it doesn’t exist. So much for the work on the project branch.

On the stable branch, things are a bit more tricky. Of course we needed to be able to continue shipping security updates from the stable branch, that is, we didn’t want to turn builds red for strings that aren’t really missing. Yet we wanted to signal that the strings are there and to be localized. Up until then, we only had two stages of strings, missing or not. The latter is what we use for handlers in region.properties, for example. We needed a third stage, “report on this string, but don’t fail”. So I added a third stage to the logic around filter.py in compare-locales. This logic is now used in filter.py on the 1.9.2 branch, but not on central. Another necessary addition was to support filter.py for each module, so that we only had to hack around the toolkit strings once, and ont for all apps on 1.9.2. So there’s now a filter.py file for toolkit on 1.9.2, making sure we only report on the lorentz strings in toolkit.

Once that logic was in place, we added a “strings-only” patch to 1.9.2, which had the benefit of exposing the en-US strings in the regular repository that our l10n community is working on.

The outcome today is that out of the 74 languages we ship, only 25 still rely on the en-US fallback strings.

In bullet points, that’d be:

  • Do not remove strings, so that newer language packs are compatible with older releases.
  • Add strings with en-US fallbacks, so that they can be localized, but don’t error when missing.
  • Make filter.py for the module (browser/mail/toolkit) “report” on the new strings, so that localizers see the strings without hiding real errors from non-fatal ones.
  • Land strings early on the stable branch to get them exposed to l10n (with filter.py, see above).

June 7, 2010

Try’ing talos on node.js

Filed under: Mozilla — Tags: — Axel Hecht @ 7:37 am

I wasn’t all happy with how django helped me in coding the try-talos visualization, so I recreated this based on node.js. The result is a single project on github, talos-node, that just requires you to get a local install of node.js. It will actually incrementally render the pages as it does server side loads, so it doesn’t look completely dead throughout. Outcome at the side is a much better interaction to figure out which test is performing how, you can now mouse-ever one result, and you see all tests, both for your try-revision and the references. I also moved away from showing the range and mean value to showing all values, so you see how your red spot is doing in the flock of blues. There’s an updated screenshot on flickr.

A few comments on hacking on node.js. The nice thing about it is, there are tons of helper modules out there. The bad thing is, most of them are not compatible with a current version of node.js. Is the buzz over?

I ended up hacking my own simple asynchronous templating engine, the guts are shown in the readme.

I hope that being just node server.js once you have node.js up, it’s gonna make people more willing to actually run it locally.

Powered by WordPress