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
|
|
|
|
|
|
|
// 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
|
|
|
},
|
|
|
|
|
|
|
|
// 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
|
|
|
},
|
|
|
|
|
|
|
|
// 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
|
|
|
},
|
|
|
|
|
|
|
|
// 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
|
|
|
},
|
|
|
|
|
|
|
|
// Armenian
|
2018-01-26 18:18:43 +00:00
|
|
|
'hy': {
|
|
|
|
languages: require('../../../../lang/languages-hy'),
|
|
|
|
main: require('../../../../lang/main-hy')
|
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
|
|
|
},
|
|
|
|
|
|
|
|
// Norwegian Bokmal
|
2018-01-26 18:18:43 +00:00
|
|
|
'nb': {
|
|
|
|
languages: require('../../../../lang/languages-nb'),
|
|
|
|
main: require('../../../../lang/main-nb')
|
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
|
|
|
},
|
|
|
|
|
|
|
|
// 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
|
|
|
},
|
|
|
|
|
|
|
|
// Slovak
|
2018-01-26 18:18:43 +00:00
|
|
|
'sk': {
|
|
|
|
languages: require('../../../../lang/languages-sk'),
|
|
|
|
main: require('../../../../lang/main-sk')
|
2017-12-22 10:26:57 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
// Slovenian
|
2018-01-26 18:18:43 +00:00
|
|
|
'sl': {
|
|
|
|
languages: require('../../../../lang/languages-sl'),
|
|
|
|
main: require('../../../../lang/main-sl')
|
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
|
|
|
},
|
|
|
|
|
|
|
|
// Turkish
|
2018-01-26 18:18:43 +00:00
|
|
|
'tr': {
|
|
|
|
languages: require('../../../../lang/languages-tr'),
|
|
|
|
main: require('../../../../lang/main-tr')
|
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')
|
2017-12-22 10:26:57 +00:00
|
|
|
}
|
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);
|
|
|
|
}
|