Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A i18n middleware for the Express.js framework.
JavaScript
branch: master

This branch is 17 commits ahead, 50 commits behind akoenig:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
example
lib
spec
.gitignore
README.md
package.json

README.md

Lingua and Lengua

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.

Installation

$ npm install lengua

Show me the code!

To translate somenthig (Coffeekup)

@t 'Name'
@t 'navigation.german'

To get the current country code, language and locale respectively

@currentCountry
@currentCountryLanguage
@currentLocale

Added features

For the common mortal

  1. User locale stored in session instead of cookie

  2. Not case sensitive

  3. Country Code

  4. If the current locale (e.g. en-US) doesnt define a key, Lengua does a lookup in the global locale (e.g. en).

Other Stuff

  1. Tests :)

TODO

  1. Locale storage as strategy (Cookie, Session, Azure, etc).

  2. Cache update (when all fallbacks fail).

Dev

Tests

npm install jasmine-node
cd spec/
jasmine-node.cmd .\guru.spec.js
jasmine-node.cmd .\lingua.spec.js

License

MIT License

Author

Copyright (c) 2011,

André König (Google+) (andre.koenig -[at]- gmail [dot] com)

Christian Berkhoff (christian.berkhoff - [at] - gmail [#dot#] com)

Something went wrong with that request. Please try again.