2018-01-26 18:18:43 +00:00
|
|
|
// @flow
|
|
|
|
|
2017-12-22 10:26:57 +00:00
|
|
|
import i18next from 'i18next';
|
|
|
|
|
|
|
|
/**
|
2018-01-26 18:18:43 +00:00
|
|
|
* The builtin languages.
|
2017-12-22 10:26:57 +00:00
|
|
|
*/
|
2018-01-26 18:18:43 +00:00
|
|
|
const _LANGUAGES = {
|
2017-12-22 10:26:57 +00:00
|
|
|
|
2019-07-22 14:56:59 +00:00
|
|
|
// Afrikaans
|
|
|
|
'af': {
|
|
|
|
languages: require('../../../../lang/languages-af'),
|
|
|
|
main: require('../../../../lang/main-af')
|
|
|
|
},
|
|
|
|
|
2020-05-25 12:05:46 +00:00
|
|
|
// Arabic
|
|
|
|
'ar': {
|
|
|
|
languages: require('../../../../lang/languages-ar'),
|
|
|
|
main: require('../../../../lang/main-ar')
|
|
|
|
},
|
|
|
|
|
2017-12-22 10:26:57 +00:00
|
|
|
// Bulgarian
|
2018-01-26 18:18:43 +00:00
|
|
|
'bg': {
|
|
|
|
languages: require('../../../../lang/languages-bg'),
|
|
|
|
main: require('../../../../lang/main-bg')
|
2017-12-22 10:26:57 +00:00
|
|
|
},
|
|
|
|
|
2020-04-13 18:45:57 +00:00
|
|
|
// Catalan
|
|
|
|
'ca': {
|
|
|
|
languages: require('../../../../lang/languages-ca'),
|
|
|
|
main: require('../../../../lang/main-ca')
|
|
|
|
},
|
2020-04-13 18:51:33 +00:00
|
|
|
|
2017-12-22 10:26:57 +00:00
|
|
|
// German
|
2018-01-26 18:18:43 +00:00
|
|
|
'de': {
|
|
|
|
languages: require('../../../../lang/languages-de'),
|
|
|
|
main: require('../../../../lang/main-de')
|
2017-12-22 10:26:57 +00:00
|
|
|
},
|
|
|
|
|
2019-07-22 14:56:59 +00:00
|
|
|
// English (United Kingdom)
|
|
|
|
'enGB': {
|
|
|
|
languages: require('../../../../lang/languages-enGB'),
|
|
|
|
main: require('../../../../lang/main-enGB')
|
|
|
|
},
|
|
|
|
|
2017-12-22 10:26:57 +00:00
|
|
|
// Esperanto
|
2018-01-26 18:18:43 +00:00
|
|
|
'eo': {
|
|
|
|
languages: require('../../../../lang/languages-eo'),
|
|
|
|
main: require('../../../../lang/main-eo')
|
2017-12-22 10:26:57 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
// Spanish
|
2018-01-26 18:18:43 +00:00
|
|
|
'es': {
|
|
|
|
languages: require('../../../../lang/languages-es'),
|
|
|
|
main: require('../../../../lang/main-es')
|
2017-12-22 10:26:57 +00:00
|
|
|
},
|
|
|
|
|
2019-07-22 14:56:59 +00:00
|
|
|
// Spanish (Latin America)
|
|
|
|
'esUS': {
|
|
|
|
languages: require('../../../../lang/languages-esUS'),
|
|
|
|
main: require('../../../../lang/main-esUS')
|
|
|
|
},
|
|
|
|
|
2020-03-27 21:19:42 +00:00
|
|
|
// Estonian
|
|
|
|
'et': {
|
|
|
|
languages: require('../../../../lang/languages-et'),
|
|
|
|
main: require('../../../../lang/main-et')
|
|
|
|
},
|
|
|
|
|
2019-07-22 14:56:59 +00:00
|
|
|
// Finnish
|
|
|
|
'fi': {
|
|
|
|
languages: require('../../../../lang/languages-fi'),
|
|
|
|
main: require('../../../../lang/main-fi')
|
|
|
|
},
|
|
|
|
|
2017-12-22 10:26:57 +00:00
|
|
|
// French
|
2018-01-26 18:18:43 +00:00
|
|
|
'fr': {
|
|
|
|
languages: require('../../../../lang/languages-fr'),
|
|
|
|
main: require('../../../../lang/main-fr')
|
2017-12-22 10:26:57 +00:00
|
|
|
},
|
|
|
|
|
2019-07-22 14:56:59 +00:00
|
|
|
// French (Canadian)
|
|
|
|
'frCA': {
|
|
|
|
languages: require('../../../../lang/languages-frCA'),
|
|
|
|
main: require('../../../../lang/main-frCA')
|
|
|
|
},
|
|
|
|
|
|
|
|
// Croatian
|
|
|
|
'hr': {
|
|
|
|
languages: require('../../../../lang/languages-hr'),
|
|
|
|
main: require('../../../../lang/main-hr')
|
2017-12-22 10:26:57 +00:00
|
|
|
},
|
|
|
|
|
2019-10-04 21:54:25 +00:00
|
|
|
// Hungarian
|
|
|
|
'hu': {
|
|
|
|
languages: require('../../../../lang/languages-hu'),
|
|
|
|
main: require('../../../../lang/main-hu')
|
|
|
|
},
|
|
|
|
|
2017-12-22 10:26:57 +00:00
|
|
|
// Italian
|
2018-01-26 18:18:43 +00:00
|
|
|
'it': {
|
|
|
|
languages: require('../../../../lang/languages-it'),
|
|
|
|
main: require('../../../../lang/main-it')
|
2017-12-22 10:26:57 +00:00
|
|
|
},
|
|
|
|
|
2019-07-22 14:56:59 +00:00
|
|
|
// Japanese
|
|
|
|
'ja': {
|
|
|
|
languages: require('../../../../lang/languages-ja'),
|
|
|
|
main: require('../../../../lang/main-ja')
|
|
|
|
},
|
|
|
|
|
|
|
|
// Korean
|
|
|
|
'ko': {
|
|
|
|
languages: require('../../../../lang/languages-ko'),
|
|
|
|
main: require('../../../../lang/main-ko')
|
|
|
|
},
|
|
|
|
|
|
|
|
// Dutch
|
|
|
|
'nl': {
|
|
|
|
languages: require('../../../../lang/languages-nl'),
|
|
|
|
main: require('../../../../lang/main-nl')
|
2017-12-22 10:26:57 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
// Occitan
|
2018-01-26 18:18:43 +00:00
|
|
|
'oc': {
|
|
|
|
languages: require('../../../../lang/languages-oc'),
|
|
|
|
main: require('../../../../lang/main-oc')
|
2017-12-22 10:26:57 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
// Polish
|
2018-01-26 18:18:43 +00:00
|
|
|
'pl': {
|
|
|
|
languages: require('../../../../lang/languages-pl'),
|
|
|
|
main: require('../../../../lang/main-pl')
|
2017-12-22 10:26:57 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
// Portuguese (Brazil)
|
2018-01-26 18:18:43 +00:00
|
|
|
'ptBR': {
|
|
|
|
languages: require('../../../../lang/languages-ptBR'),
|
|
|
|
main: require('../../../../lang/main-ptBR')
|
2017-12-22 10:26:57 +00:00
|
|
|
},
|
|
|
|
|
2020-04-29 19:07:51 +00:00
|
|
|
// Sardinian (Sardinia)
|
|
|
|
'sc': {
|
|
|
|
languages: require('../../../../lang/languages-sc'),
|
|
|
|
main: require('../../../../lang/main-sc')
|
|
|
|
},
|
|
|
|
|
2020-05-26 13:05:41 +00:00
|
|
|
// Romanian
|
|
|
|
'ro': {
|
|
|
|
languages: require('../../../../lang/languages-ro'),
|
|
|
|
main: require('../../../../lang/main-ro')
|
|
|
|
},
|
|
|
|
|
2017-12-22 10:26:57 +00:00
|
|
|
// Russian
|
2018-01-26 18:18:43 +00:00
|
|
|
'ru': {
|
|
|
|
languages: require('../../../../lang/languages-ru'),
|
|
|
|
main: require('../../../../lang/main-ru')
|
2017-12-22 10:26:57 +00:00
|
|
|
},
|
|
|
|
|
2020-04-17 12:02:22 +00:00
|
|
|
// Slovak
|
|
|
|
'sk': {
|
|
|
|
languages: require('../../../../lang/languages-sk'),
|
|
|
|
main: require('../../../../lang/main-sk')
|
|
|
|
},
|
|
|
|
|
2017-12-22 10:26:57 +00:00
|
|
|
// Swedish
|
2018-01-26 18:18:43 +00:00
|
|
|
'sv': {
|
|
|
|
languages: require('../../../../lang/languages-sv'),
|
|
|
|
main: require('../../../../lang/main-sv')
|
2017-12-22 10:26:57 +00:00
|
|
|
},
|
|
|
|
|
2020-05-25 11:46:37 +00:00
|
|
|
// Slovenian
|
|
|
|
'sl': {
|
|
|
|
languages: require('../../../../lang/languages-sl'),
|
|
|
|
main: require('../../../../lang/main-sl')
|
|
|
|
},
|
|
|
|
|
2020-04-29 21:27:37 +00:00
|
|
|
// Turkish
|
|
|
|
'tr': {
|
|
|
|
languages: require('../../../../lang/languages-tr'),
|
|
|
|
main: require('../../../../lang/main-tr')
|
|
|
|
},
|
|
|
|
|
2019-07-22 14:56:59 +00:00
|
|
|
// Vietnamese
|
|
|
|
'vi': {
|
|
|
|
languages: require('../../../../lang/languages-vi'),
|
|
|
|
main: require('../../../../lang/main-vi')
|
2017-12-22 10:26:57 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
// Chinese (China)
|
2018-01-26 18:18:43 +00:00
|
|
|
'zhCN': {
|
|
|
|
languages: require('../../../../lang/languages-zhCN'),
|
|
|
|
main: require('../../../../lang/main-zhCN')
|
2019-07-22 14:56:59 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
// Chinese (Taiwan)
|
|
|
|
'zhTW': {
|
|
|
|
languages: require('../../../../lang/languages-zhTW'),
|
|
|
|
main: require('../../../../lang/main-zhTW')
|
2020-04-10 17:04:48 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
// Mongolian
|
|
|
|
'mn': { languages: require('../../../../lang/languages-mn'),
|
|
|
|
main: require('../../../../lang/main-mn') }
|
2018-01-26 18:18:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Register all builtin languages with the i18n library.
|
|
|
|
for (const name in _LANGUAGES) { // eslint-disable-line guard-for-in
|
|
|
|
const { languages, main } = _LANGUAGES[name];
|
2017-12-22 10:26:57 +00:00
|
|
|
|
|
|
|
i18next.addResourceBundle(
|
2018-01-26 18:18:43 +00:00
|
|
|
name,
|
|
|
|
'languages',
|
|
|
|
languages,
|
2017-12-22 10:26:57 +00:00
|
|
|
/* deep */ true,
|
|
|
|
/* overwrite */ true);
|
|
|
|
i18next.addResourceBundle(
|
2018-01-26 18:18:43 +00:00
|
|
|
name,
|
|
|
|
'main',
|
|
|
|
main,
|
2017-12-22 10:26:57 +00:00
|
|
|
/* deep */ true,
|
|
|
|
/* overwrite */ true);
|
|
|
|
}
|