BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News L20n: JavaScript Localization Framework From Mozilla

L20n: JavaScript Localization Framework From Mozilla

Lire ce contenu en français

L20n is an open source, JavaScript localization framework from Mozilla. It is designed to be very expressive along with several features such as adapting to Screen sizes, good separation of concerns, graceful handling of pluralization, support for default when there are multiple variants, and more. 

Staś Małolepszy explains the motivation behind the project -

Localizing Mozilla projects has taught us that as many as 90-95% of messages found in the UI are simple key-value pairs that won't require any advanced knowledge of L20n's features.

So why develop L20n at all? Because it's the remaining 5% that make or break the UI of your app. They're too important to ignore and they are responsible for the experience of your user.

As such, the project tries to keep simple scenarios simple, but also supports complex localizations when needed.

Below are some interesting features of L20n -

A simple but powerful concept that L20n introduces is the concept of Defaults - this allows you to define multiple variants for an entity but also define a default value in case any specific variant is not asked for. This enables translators to progressively tweak their content and even add more variants, while ensuring that existing code using these entities are not affected (by just choosing a default). This is what also allows different localizations to have different degrees of complexity without having to complicate all other localizations.

Here are a few resources to learn more about the project -

L20n has been in development since 2012 and the release candidate for 1.0 has been out since November 2013.

Rate this Article

Adoption
Style

BT