fix(i18n) fix some country names

This commit is contained in:
Saúl Ibarra Corretgé 2022-02-28 09:14:20 +01:00 committed by Saúl Ibarra Corretgé
parent c8895b2d04
commit c9ea193d04
1 changed files with 16 additions and 1 deletions

View File

@ -5,6 +5,7 @@ declare var APP: Object;
import COUNTRIES_RESOURCES from 'i18n-iso-countries/langs/en.json';
import i18next from 'i18next';
import I18nextXHRBackend from 'i18next-xhr-backend';
import _ from 'lodash';
import LANGUAGES_RESOURCES from '../../../../lang/languages.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 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.
*
@ -68,7 +83,7 @@ i18next
i18next.addResourceBundle(
DEFAULT_LANGUAGE,
'countries',
COUNTRIES_RESOURCES,
COUNTRIES,
/* deep */ true,
/* overwrite */ true);
i18next.addResourceBundle(