This repository has been archived by the owner on Jan 22, 2021. It is now read-only.
forked from ro31337/libretaxi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
supported-locales.js
43 lines (42 loc) · 1.39 KB
/
supported-locales.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* @typedef LocaleMap
* @desc Key/value map where:
* - key - locale
* - value - title
* Note: Map _guarantees_ the keys order. But it shouldn't be initialized with object (where
* order is not guaranteed). This data structure is similar to rails OrderedHash where we can
* rely on order and have advantage of quick lookup by the key.
* @extends {Map}
* @see https://mzl.la/2jRpmTI
*/
const localeMap = new Map();
localeMap.set('en', 'English');
localeMap.set('es', 'Español');
localeMap.set('fa', 'فارسی');
localeMap.set('zh-cn', '官话');
localeMap.set('zh-tw', '繁體中文');
localeMap.set('ru', '🇷🇺 Русский');
localeMap.set('pt-br', '🇧🇷 Português');
localeMap.set('fr', 'Français');
localeMap.set('de', 'Deutsch');
localeMap.set('pl', '🇵🇱 Język polski');
localeMap.set('tr', '🇹🇷 Türkçe');
localeMap.set('id', '🇮🇩 Bahasa Indonesia');
/**
* @typedef SupportedLocales
* @desc Array set that represents the list of currently supported locales:
* - `en` - English locale
* - `ru` - Russian locale
* @extends {Array}
* @author Roman Pushkin ([email protected])
* @date 2016-06-17
* @version 1.1
* @since 0.1.0
* @example
* import SupportedLocales from './supported-locales';
* if (!SupportedLocales.includes('cn')) {
* console.log('locale "cn" is not supported yet');
* }
*/
export default Array.from(localeMap.keys());
export { localeMap };