Lingua is a middleware for the Express.js framework that helps you to internationalise your webapp easily. It determines the language of the user agent and pushes the i18n resources to your views.
Lengua is a fork form Lingua which introduces some features.
$ npm install lengua
To translate somenthig (Coffeekup)
@t 'Name' @t 'navigation.german'
To get the current country code, language and locale respectively
@currentCountry @currentCountryLanguage @currentLocale
-
User locale stored in session instead of cookie
-
Not case sensitive
-
Country Code
-
If the current locale (e.g. en-US) doesnt define a key, Lengua does a lookup in the global locale (e.g. en).
- Tests :)
-
Locale storage as strategy (Cookie, Session, Azure, etc).
-
Cache update (when all fallbacks fail).
npm install jasmine-node cd spec/ jasmine-node.cmd .\guru.spec.js jasmine-node.cmd .\lingua.spec.js
Copyright (c) 2011,
André König (Google+) (andre.koenig -[at]- gmail [dot] com)
Christian Berkhoff (christian.berkhoff - [at] - gmail [#dot#] com)