forked from ro31337/libretaxi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
supported-locales.js
72 lines (67 loc) · 2.59 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
LibreTaxi, free and open source ride sharing platform.
Copyright (C) 2016-2017 Roman Pushkin
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @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('jp', '🇯🇵 日本語');
localeMap.set('fr', 'Français');
localeMap.set('de', 'Deutsch');
localeMap.set('it', '🇮🇹 Italiano');
localeMap.set('pt-br', '🇧🇷 Português');
localeMap.set('sv', '🇸🇪 Svenska');
localeMap.set('pl', '🇵🇱 Polski');
localeMap.set('cz', '🇨🇿 Česky');
localeMap.set('tr', '🇹🇷 Türkçe');
localeMap.set('am', '🇦🇲 Հայերեն');
localeMap.set('ru', '🇷🇺 Русский');
localeMap.set('ua', '🇺🇦 Українська');
localeMap.set('ro', '🇷🇴 Română');
localeMap.set('hi', 'हिन्दी');
localeMap.set('ta', 'தமிழ்');
localeMap.set('id', '🇮🇩 Bahasa Indonesia');
localeMap.set('vi', '🇻🇳 Tiếng Việt');
/**
* @typedef SupportedLocales
* @desc Array set that represents the list of currently supported locales:
* - `en` - English locale
* - `ru` - Russian locale
* etc..
* @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 };