fix(i18n) fix some country names
This commit is contained in:
parent
c8895b2d04
commit
c9ea193d04
|
@ -5,6 +5,7 @@ declare var APP: Object;
|
||||||
import COUNTRIES_RESOURCES from 'i18n-iso-countries/langs/en.json';
|
import COUNTRIES_RESOURCES from 'i18n-iso-countries/langs/en.json';
|
||||||
import i18next from 'i18next';
|
import i18next from 'i18next';
|
||||||
import I18nextXHRBackend from 'i18next-xhr-backend';
|
import I18nextXHRBackend from 'i18next-xhr-backend';
|
||||||
|
import _ from 'lodash';
|
||||||
|
|
||||||
import LANGUAGES_RESOURCES from '../../../../lang/languages.json';
|
import LANGUAGES_RESOURCES from '../../../../lang/languages.json';
|
||||||
import MAIN_RESOURCES from '../../../../lang/main.json';
|
import MAIN_RESOURCES from '../../../../lang/main.json';
|
||||||
|
@ -12,6 +13,20 @@ import MAIN_RESOURCES from '../../../../lang/main.json';
|
||||||
import { I18NEXT_INITIALIZED, LANGUAGE_CHANGED } from './actionTypes';
|
import { I18NEXT_INITIALIZED, LANGUAGE_CHANGED } from './actionTypes';
|
||||||
import languageDetector from './languageDetector';
|
import languageDetector from './languageDetector';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override certain country names.
|
||||||
|
*/
|
||||||
|
const COUNTRIES_RESOURCES_OVERRIDES = {
|
||||||
|
countries: {
|
||||||
|
TW: 'Taiwan'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Merged country names.
|
||||||
|
*/
|
||||||
|
const COUNTRIES = _.merge({}, COUNTRIES_RESOURCES, COUNTRIES_RESOURCES_OVERRIDES);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The available/supported languages.
|
* The available/supported languages.
|
||||||
*
|
*
|
||||||
|
@ -68,7 +83,7 @@ i18next
|
||||||
i18next.addResourceBundle(
|
i18next.addResourceBundle(
|
||||||
DEFAULT_LANGUAGE,
|
DEFAULT_LANGUAGE,
|
||||||
'countries',
|
'countries',
|
||||||
COUNTRIES_RESOURCES,
|
COUNTRIES,
|
||||||
/* deep */ true,
|
/* deep */ true,
|
||||||
/* overwrite */ true);
|
/* overwrite */ true);
|
||||||
i18next.addResourceBundle(
|
i18next.addResourceBundle(
|
||||||
|
|
Loading…
Reference in New Issue