mashpie/i18n-node — pull request #131 by oliversalzburg (2014-10-09 13:44:20+00:00)
Title: Allow the user to define fallbacks for locales and languages

Using the `fallbacks` map in the options array, the user can define which locales or languages should be mapped to which locale or language.

As an example, we use this fallback system like so:

```js
i18n.configure( {
locales : [ "en-US", "de-DE" ],
fallbacks : { "en" : "en-US", "de" : "de-DE" },
defaultLocale : "en-US"
} );
```

This allows us to be explicit in our locale definition (using "de-DE" instead of "de"), but map other regions to the same language.

The current fallback mechanism in `guessLanguage` does not provide the same kind of functionality or flexibility.

Please note that the tests currently forcibly remove the i18n instance from the cache to allow proper recreation of the loaded locales. This would be fixed by #130