65 articles and counting

How the Node Based BrowserID Service Shipped 28 New Languages

Update: Ukraine translation of this article.

Our amazing community has localized the BrowserID service into 28 languages.

browserid_zh-TW

If you are a website who is using navigator.id to authenticate your users, you
don’t have to do anything special
, your users will start having a better experience… today.

Woah, that just happened.

I wanted to share a little bit about the people and the technology.

People

Mathjazz did a great job leading the l10n effort, with pike and milos also involved.

I’ve helped with 7 “from scratch” localizations at Mozilla and this was the smoothest yet. The l10n drivers have done a ton of work to make collaborating on websites and services better.

It’s not an easy task to help coordinate volunteer efforts. You can see everyone who is involved and what locales new locales are coming soon; check out our Verbatim.

browserid_el

Technology

Node.js LogoWith our launch, we’re probably unique in being a Node app at our scale with the breadth of languages supported. We use the express framework;
doing l10n on Node is totally possible ;)

Under the guidance of l10n drivers, we’ve reused all of our standard web l10n practices. That means
Gettext for strings and SVN for the locale directory (let us not speak of SVN again).

We used the following libraries and tools:

  • node-gettext – server side string lookup from .mo files
  • GNU Gettext – string extraction, merging, etc
  • Translate Toolkit – podebug for debug locale

We wrote the following bits:

  • Client side gettext library
  • Custom middleware for accept language, exposing gettext, etc
  • Various conversion scripts

We do string lookups on both the server and the client side. In the browser, JSON blobs are minified and concatenated into our usual JavaScript bundle.

Having excellent Django codebases like zamboni (AMO) and kitsune (SUMO) to reference was also really helpful.

We ran into a shocking low number of i18n bugs, given that Express and Node don’t have an officially blessed stack to do l10n on.

A Call for Help

This release also brought in many new contributors to the project porting Perl code, reporting bugs, and other new energy that is critical to the Mozilla project.

As with any release, there are things we didn’t have enough people to accomplish. We need your help!

  • CSS Help – Help support the visual design for RTL locales like Hebrew?
  • Tools Help – More robust string extraction

Thanks again to everyone involved in this release. If you are waiting to try integrating BrowserID “because it only works in English”, you’re running out of excuses :)

Go migrate your site’s authentication today. Get your users off of passwords. With an additional 14 locales in the works, tomorrow promises to bring even friendlier auth flows.

Ukraine translation by Android SDK, thanks!

2 Responses to “How the Node Based BrowserID Service Shipped 28 New Languages”

1
Arpad Borsos - 16/02/12
Awesome!
Is it possible to package the i18n middleware as a separate package? That would be awesome for node apps. I have done a litte custom l10n solution but thats not very sophisticated.
2
ozten - 16/02/12
@Arpad Good call, I will create a node module called i18n-abide and package up the various bits.

That will appear at https://github.com/mozilla/node-i18n-abide/, I'll email you when it's published on npm.

In the mean time, https://github.com/mozilla/browserid/blob/dev/lib/i18n.js is the middleware.