locale-helpers
Infers the best valid locale for a given language/country combination.
Sometimes the locale is simply the language/country combination, e.g. en
+ US
= en_US
.
However, it
+ FR
≠ it_FR
(as it is not a valid locale). A better option is the valid it_IT
.
Usage
Install the library with npm install locale-helpers
var LocaleHelpers = LocaleHelpers; LocaleHelpers; //-> 'en_US'LocaleHelpers; //-> 'fr_FR'LocaleHelpers; //-> 'en_GB'LocaleHelpers; //-> 'it_IT'