Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/olizilla/lol
A CLI tool to get local and english language names from a directory of locales.
https://github.com/olizilla/lol
Last synced: 9 days ago
JSON representation
A CLI tool to get local and english language names from a directory of locales.
- Host: GitHub
- URL: https://github.com/olizilla/lol
- Owner: olizilla
- License: mit
- Created: 2018-11-02T16:59:58.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-10T20:27:06.000Z (over 3 years ago)
- Last Synced: 2024-10-08T00:24:44.871Z (3 months ago)
- Language: JavaScript
- Size: 185 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lol - locale-to-language
A CLI tool to get local and english language names from a directory of locales.
Language names are pulled from [mozilla/language-mapping-list](https://github.com/mozilla/language-mapping-list/blob/master/language-mapping-list.js)
## Install
```console
npm install -g @olizilla/lol
```or just use it via `npx`
```console
npx -q @olizilla/lol public/locales > src/lib/languages.json
```## Usage
In your favorite shell, pass lol the directory where you keep your locales
```
$ ls ~/Code/ipfs-shipyard/ipfs-webui/public/locales/ | grep zh
zh-CN
zh-HK
zh-TW$ lol ~/Code/ipfs-shipyard/ipfs-webui/public/locales/
{
"uk": {
"locale": "uk",
"nativeName": "Українська",
"englishName": "Ukrainian"
},
"zh-CN": {
"locale": "zh-CN",
"nativeName": "中文(中国)",
"englishName": "Chinese Simplified (China)"
},
"zh-HK": {
"locale": "zh-HK",
"nativeName": "中文(香港)",
"englishName": "Chinese Traditional (Hong Kong)"
},
"zh-TW": {
"locale": "zh-TW",
"nativeName": "中文(台灣)",
"englishName": "Chinese Traditional (Taiwan)"
}
}
```