https://github.com/creativelive/rind-locale
Find a locale match for a string of locale(s) in an array of [supported] locales
https://github.com/creativelive/rind-locale
Last synced: over 1 year ago
JSON representation
Find a locale match for a string of locale(s) in an array of [supported] locales
- Host: GitHub
- URL: https://github.com/creativelive/rind-locale
- Owner: creativelive
- License: mit
- Created: 2014-06-03T01:03:49.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-13T05:54:09.000Z (about 12 years ago)
- Last Synced: 2025-02-26T06:38:16.278Z (over 1 year ago)
- Language: JavaScript
- Size: 145 KB
- Stars: 0
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rind-locale [](https://travis-ci.org/creativelive/rind-locale)
Find a locale match for a string of locale(s) in an array of [supported] locales
## Usage
```
var locale = require('..')({
// first locale is also the final fallback default
locales: ['de', 'en-US', 'ja', 'kr', 'zh-TW']
})
console.log(locale('ja')); // ja
console.log(locale('ja,en')); // ja
console.log(locale('en-UK')); // en-US
console.log(locale('klingon')); // de
```