From d2d42a7409546f6231fdb5d00297f2a88b295439 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Tue, 18 Sep 2018 13:12:10 +0200 Subject: [PATCH] feat(i18n): use custom Chinese language names --- app/lib/utils/i18n.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/lib/utils/i18n.js b/app/lib/utils/i18n.js index da10ad13..fa147453 100644 --- a/app/lib/utils/i18n.js +++ b/app/lib/utils/i18n.js @@ -85,7 +85,8 @@ export const locales = [ 'sv', 'tr', 'uk', - 'zh' + 'zh-CN', + 'zh-TW' ] // Defaine list of currencies that we will support. @@ -165,6 +166,15 @@ export const getLocale = () => { * @return {string} Language code. */ export const getLanguageName = lang => { + const customNames = { + el: 'Greek', + 'zh-CN': 'Chinese (Simplified, PRC)', + 'zh-TW': 'Chinese (Traditional, Taiwan)' + } + if (customNames[lang]) { + return customNames[lang] + } + const language = lang.toLowerCase().split(/[_-]+/)[0] const data = lookup.languages({ alpha2: language }) const name = get(data, '[0]name', language)