L20n

This is a sample implementation of L20n in JavaScript. The examples are designed to work in Firefox 2, and may work in other browsers. The code itself is under an MIT license, like the MDC samples are.

This is also a bzr repository, so you can pull this code and hack on 'em, simply

bzr branch http://people.mozilla.com/~axel/l20n/js-l20n

Toolkit strings and apps
This sample shows how to compose strings with different genders, and that the complexity needed by the language is just inside the locale files.
Accesskeys
This sample shows how to keep things together that belong together. In this case, that happens to be the value and the accesskey attributes for a HTML button. (Sadly, the accesskey doesn't work in fx2, tips?)
Language fallback
This sample shows how to implement one locale falling back to another. Using en-GB and en-US with en-GB falling back to en-US is merely because I don't speak any interesting languages, but the fallback path is totally programmatic and can be any locale to any other.
Plurals
This sample shows how to use plural macros to implement flexible strings depending on an unknown quantity.
Declensions and special cases
This sample shows how to do declensions, and even special cases for particular strings. It also shows how the complexity arising here is kept to the affected locale (in this case, Finish). Thanks to Sini Ruohomaa for the request.