2017-09-21 11:54:41 -04:00
|
|
|
|
/**
|
|
|
|
|
* Currently supported locales for the Scratch Project
|
|
|
|
|
* @type {Object} Key Value pairs of locale code: Language name written in the language
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
const locales = {
|
2018-05-21 09:42:53 -04:00
|
|
|
|
'ab': {name: 'Аҧсшәа'},
|
2021-01-25 15:19:04 -05:00
|
|
|
|
'af': {name: 'Afrikaans'},
|
2018-10-10 17:47:46 -04:00
|
|
|
|
'ar': {name: 'العربية'},
|
2018-09-18 16:58:25 -04:00
|
|
|
|
'am': {name: 'አማርኛ'},
|
2021-08-04 10:55:34 -04:00
|
|
|
|
'an': {name: 'Aragonés'},
|
2018-07-19 09:31:11 -04:00
|
|
|
|
'az': {name: 'Azeri'},
|
2018-06-19 16:57:48 -04:00
|
|
|
|
'id': {name: 'Bahasa Indonesia'},
|
2021-08-04 10:55:34 -04:00
|
|
|
|
'bn': {name: 'বাংলা'},
|
2019-04-24 08:37:27 -04:00
|
|
|
|
'be': {name: 'Беларуская'},
|
2019-03-28 04:37:27 -04:00
|
|
|
|
'bg': {name: 'Български'},
|
2018-05-21 09:42:53 -04:00
|
|
|
|
'ca': {name: 'Català'},
|
|
|
|
|
'cs': {name: 'Česky'},
|
|
|
|
|
'cy': {name: 'Cymraeg'},
|
2018-06-19 16:57:48 -04:00
|
|
|
|
'da': {name: 'Dansk'},
|
2018-05-21 09:42:53 -04:00
|
|
|
|
'de': {name: 'Deutsch'},
|
2018-07-12 13:43:00 -04:00
|
|
|
|
'et': {name: 'Eesti'},
|
2018-05-21 09:42:53 -04:00
|
|
|
|
'el': {name: 'Ελληνικά'},
|
|
|
|
|
'en': {name: 'English'},
|
2021-06-14 16:34:27 -04:00
|
|
|
|
'es': {name: 'Español (España)'},
|
2018-05-21 09:42:53 -04:00
|
|
|
|
'es-419': {name: 'Español Latinoamericano'},
|
2018-09-18 16:58:25 -04:00
|
|
|
|
'eu': {name: 'Euskara'},
|
2019-02-06 17:09:23 -05:00
|
|
|
|
'fa': {name: 'فارسی'},
|
2018-05-21 09:42:53 -04:00
|
|
|
|
'fr': {name: 'Français'},
|
2021-08-04 10:55:34 -04:00
|
|
|
|
'fy': {name: 'Frysk'},
|
2018-05-21 09:42:53 -04:00
|
|
|
|
'ga': {name: 'Gaeilge'},
|
|
|
|
|
'gd': {name: 'Gàidhlig'},
|
2018-06-19 16:57:48 -04:00
|
|
|
|
'gl': {name: 'Galego'},
|
2018-07-12 13:43:00 -04:00
|
|
|
|
'ko': {name: '한국어'},
|
2020-05-11 14:23:22 -04:00
|
|
|
|
'hy': {name: 'Հայերեն'},
|
2018-05-21 09:42:53 -04:00
|
|
|
|
'he': {name: 'עִבְרִית'},
|
2018-11-15 08:36:52 -05:00
|
|
|
|
'hr': {name: 'Hrvatski'},
|
2021-01-25 15:19:04 -05:00
|
|
|
|
'xh': {name: 'isiXhosa'},
|
2018-12-13 09:07:56 -05:00
|
|
|
|
'zu': {name: 'isiZulu'},
|
2018-08-10 09:25:02 -04:00
|
|
|
|
'is': {name: 'Íslenska'},
|
2018-05-21 09:42:53 -04:00
|
|
|
|
'it': {name: 'Italiano'},
|
2019-07-24 09:14:38 -04:00
|
|
|
|
'ka': {name: 'ქართული ენა'},
|
2021-06-11 14:40:15 -04:00
|
|
|
|
'kk': {name: 'қазақша'},
|
2021-01-25 15:19:04 -05:00
|
|
|
|
'qu': {name: 'Kichwa'},
|
2019-10-08 07:38:05 -04:00
|
|
|
|
'sw': {name: 'Kiswahili'},
|
2019-12-18 14:47:55 -05:00
|
|
|
|
'ht': {name: 'Kreyòl ayisyen'},
|
2020-03-24 15:24:44 -04:00
|
|
|
|
'ku': {name: 'Kurdî'},
|
2019-02-06 17:09:23 -05:00
|
|
|
|
'ckb': {name: 'کوردیی ناوەندی'},
|
2019-01-16 09:45:13 -05:00
|
|
|
|
'lv': {name: 'Latviešu'},
|
2018-08-17 09:49:52 -04:00
|
|
|
|
'lt': {name: 'Lietuvių'},
|
2018-12-20 13:29:45 -05:00
|
|
|
|
'hu': {name: 'Magyar'},
|
|
|
|
|
'mi': {name: 'Māori'},
|
2020-06-17 07:10:03 -04:00
|
|
|
|
'mn': {name: 'Монгол хэл'},
|
2018-05-21 09:42:53 -04:00
|
|
|
|
'nl': {name: 'Nederlands'},
|
2018-07-12 13:43:00 -04:00
|
|
|
|
'ja': {name: '日本語'},
|
|
|
|
|
'ja-Hira': {name: 'にほんご'},
|
2018-05-21 09:42:53 -04:00
|
|
|
|
'nb': {name: 'Norsk Bokmål'},
|
2019-01-16 09:45:13 -05:00
|
|
|
|
'nn': {name: 'Norsk Nynorsk'},
|
2021-01-25 15:19:04 -05:00
|
|
|
|
'or': {name: 'ଓଡ଼ିଆ'},
|
2019-05-08 16:01:46 -04:00
|
|
|
|
'uz': {name: 'Oʻzbekcha'},
|
2018-06-19 16:57:48 -04:00
|
|
|
|
'th': {name: 'ไทย'},
|
2019-07-23 15:33:31 -04:00
|
|
|
|
'km': {name: 'ភាសាខ្មែរ'},
|
2018-07-19 09:31:11 -04:00
|
|
|
|
'pl': {name: 'Polski'},
|
2018-05-21 09:42:53 -04:00
|
|
|
|
'pt': {name: 'Português'},
|
|
|
|
|
'pt-br': {name: 'Português Brasileiro'},
|
2019-05-08 16:01:46 -04:00
|
|
|
|
'rap': {name: 'Rapa Nui'},
|
2018-10-10 17:47:46 -04:00
|
|
|
|
'ro': {name: 'Română'},
|
2018-07-19 09:31:11 -04:00
|
|
|
|
'ru': {name: 'Русский'},
|
2021-01-25 15:19:04 -05:00
|
|
|
|
'nso': {name: 'Sepedi'},
|
|
|
|
|
'tn': {name: 'Setswana'},
|
2019-01-16 09:45:13 -05:00
|
|
|
|
'sk': {name: 'Slovenčina'},
|
2018-05-21 09:42:53 -04:00
|
|
|
|
'sl': {name: 'Slovenščina'},
|
2021-01-25 15:19:04 -05:00
|
|
|
|
'sr': {name: 'Српски'},
|
2018-06-19 16:57:48 -04:00
|
|
|
|
'fi': {name: 'Suomi'},
|
|
|
|
|
'sv': {name: 'Svenska'},
|
|
|
|
|
'vi': {name: 'Tiếng Việt'},
|
2018-05-21 09:42:53 -04:00
|
|
|
|
'tr': {name: 'Türkçe'},
|
|
|
|
|
'uk': {name: 'Українська'},
|
|
|
|
|
'zh-cn': {name: '简体中文'},
|
|
|
|
|
'zh-tw': {name: '繁體中文'}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const customLocales = {
|
|
|
|
|
'ab': {
|
|
|
|
|
locale: 'ab',
|
2021-05-28 16:52:46 -04:00
|
|
|
|
parentLocale: 'ru'
|
2018-05-21 09:42:53 -04:00
|
|
|
|
},
|
2021-08-04 10:55:34 -04:00
|
|
|
|
// Aragonese is not in the locale data, using es for Spain
|
|
|
|
|
'an': {
|
|
|
|
|
locale: 'an',
|
|
|
|
|
parentLocale: 'es'
|
|
|
|
|
},
|
2021-05-28 16:52:46 -04:00
|
|
|
|
// haitian creole is not in locale-langData
|
2019-12-18 14:47:55 -05:00
|
|
|
|
'ht': {
|
|
|
|
|
locale: 'ht',
|
|
|
|
|
parentLocale: 'fr'
|
|
|
|
|
},
|
2019-05-08 16:01:46 -04:00
|
|
|
|
'rap': {
|
|
|
|
|
locale: 'rap',
|
|
|
|
|
parentLocale: 'es'
|
|
|
|
|
},
|
2021-05-28 16:52:46 -04:00
|
|
|
|
// TODO: replace zh-cn, zh-tw with zh-Hans and zh-Hant then customLocales is unnecessary
|
2018-05-21 09:42:53 -04:00
|
|
|
|
'zh-cn': {
|
|
|
|
|
locale: 'zh-cn',
|
|
|
|
|
parentLocale: 'zh'
|
|
|
|
|
},
|
|
|
|
|
'zh-tw': {
|
|
|
|
|
locale: 'zh-tw',
|
|
|
|
|
parentLocale: 'zh'
|
|
|
|
|
}
|
2017-09-21 11:54:41 -04:00
|
|
|
|
};
|
|
|
|
|
|
2018-11-25 18:05:44 -05:00
|
|
|
|
const localeMap = {
|
|
|
|
|
'aa-dj': 'aa_DJ',
|
|
|
|
|
'es-419': 'es_419',
|
|
|
|
|
// ja-Hira: no map - it's 'ja-Hira' on transifex
|
|
|
|
|
'pt-br': 'pt_BR',
|
|
|
|
|
'zh-cn': 'zh_CN',
|
|
|
|
|
'zh-tw': 'zh_TW'
|
|
|
|
|
};
|
|
|
|
|
|
2018-08-17 09:34:12 -04:00
|
|
|
|
// list of RTL locales supported, and a function to check whether a locale is RTL
|
|
|
|
|
const rtlLocales = [
|
2018-10-10 17:47:46 -04:00
|
|
|
|
'ar',
|
2019-02-06 17:09:23 -05:00
|
|
|
|
'ckb',
|
|
|
|
|
'fa',
|
2018-08-17 09:34:12 -04:00
|
|
|
|
'he'
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const isRtl = locale => {
|
|
|
|
|
return rtlLocales.indexOf(locale) !== -1;
|
|
|
|
|
};
|
|
|
|
|
|
2021-05-28 16:52:46 -04:00
|
|
|
|
export {locales as default, customLocales, localeMap, isRtl};
|