From fa25ffdf24f5dd32901bb7593fa6ef31d4aff39c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Mon, 28 Feb 2022 09:14:20 +0100 Subject: [PATCH] fix(i18n) fix some country names --- react/features/base/i18n/i18next.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/react/features/base/i18n/i18next.js b/react/features/base/i18n/i18next.js index 0f2f3041d..68fedd4c5 100644 --- a/react/features/base/i18n/i18next.js +++ b/react/features/base/i18n/i18next.js @@ -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(