1.0.2 • Published 10 years ago
current_locale v1.0.2
current_locale
What
A simple function which returns current locale.
How
Call it using getUserLanguage(options), where options - is an optional object.
Options?
It has two options:
- supportedLocales is an array of supported locales. If it is passed and the browser locale is not one of them, then the function will return false.
- fallbackLocale is a name of a locale which should be returned if browser locale is not one of supportedLocales.
Browser support
All modern browsers and even some IEs.
Testing
Test it with this command:
$ mocha
1.0.2
10 years ago