Free email newsletter: “ES.next News

2012-11-21

Jed – a JavaScript internationalization toolkit

Internationalization is still a tricky problem: we are still figuring out how to encode text properly, let alone store content in a manner that lets us translate it easily. In contrast, in other areas of web development, tools and technologies are in place so that even non-technical users can be productive. One example is content authoring – you don’t have to know how to write HTML or how to set up a server in order to publish a blog.

The Jed internationalization toolkit

Alex Sexton describes the goals for his Jed Toolkit as follows:
The process of getting an app translated is cumbersome, and is a blocker to getting good applications out there. FTP zips and crazy XML specs mixed with Word Documents rule the landscape. There are no decent apis, or automatic integrations that anybody is using at scale. I want to set out to change this.
The Jed Toolkit has been accepted into the Dojo Foundation (which, apart from the obvious Dojo Toolkit, hosts many projects, e.g. RequireJS and Sizzle). It is just starting and still work in progress. The idea is to attack the problem from three angles:
  1. libraries
  2. build tools for developers
  3. tools for translators
The last angle is important, because sufficiently sophisticated libraries will use syntax that is too complicated for most translators.

Data formats for storing internationalized text

The foundation that connects libraries and tools is a data format for storing internationalized text. Two popular candidates are:
  • GNU gettext: is popular in the Unix world, but can only handle one translation dimension (such as grammatical number, gender or other context) well. Even a simple example, such as a sentence containing two words with varying multiplicity, involves more than one dimension. Namely, twice the dimension “grammatical number”.
  • ICU MessageFormat: handles multiple dimensions well. Quoting Sexton: “I really liked how ICU MessageFormat made a lot of decisions based on how translators think, instead of how programmers think.”.
Jed will adopt the ICU MessageFormat. The first part of the project is a JavaScript library for this format, to be used mainly in browsers.

More information

Consult Sexton’s JSConf.eu talk “Client Side Internationalization” and the accompanying blog post for more information on Jed.

Related blog posts:

No comments: