diff --git a/src/components/SelectLang/index.js b/src/components/SelectLang/index.js index 69e56fe3e73b7d332b329a504a60bc16696f2e61..5e1d6fa377c95944700cd49573d0c487bec9c90d 100644 --- a/src/components/SelectLang/index.js +++ b/src/components/SelectLang/index.js @@ -13,32 +13,29 @@ export default class SelectLang extends PureComponent { render() { const { className } = this.props; const selectedLang = getLocale(); + const locales = ["zh-CN", "zh-TW", "en-US", "pt-BR"]; + const languageLabels = { + "zh-CN": "简体中文", + "zh-TW": "繁体中文", + "en-US": "English", + "pt-BR": "Português", + }; + const languageIcons = { + "zh-CN": "🇨🇳", + "zh-TW": "🇭🇰", + "en-US": "🇬🇧", + "pt-BR": "🇵🇹", + }; const langMenu = ( - - - 🇨🇳 - {' '} - 简体中文 - - - - 🇭🇰 - {' '} - 繁体中文 - - - - 🇬🇧 - {' '} - English - - - - 🇵🇹 - {' '} - Português - + {locales.map(locale => ( + + + {languageIcons[locale]} + {' '} + {languageLabels[locale]} + + ))} ); return (