Overview
Small package to normalize locales across different standards.
Installation
npm install --save locales-normalizer
Usage
The normalizer has two methods, normalize()
and getLanguage()
:
normalize()
receives the language code and returns a normal version (e.g. en_US -> en-US)getLanguage()
receives the language code and returns some extra information about the language.
Example
const localeNormalizer = require('locales-normalizer');
const locale = 'en_US';
console.log(localeNormalizer.normalize(locale));
console.log(localeNormalizer.getLanguage(locale));