diff --git a/app/configs/app.config.js b/app/configs/app.config.js index d5f672b98c..9289b7ec29 100644 --- a/app/configs/app.config.js +++ b/app/configs/app.config.js @@ -1,28 +1,33 @@ import settings from '../shared/settings'; +const languageList = [ + {name: 'Arabic', code: 'ar', original: 'العربية'}, + {name: 'Chinese Simplified', code: 'zh-CN', original: '中文简体'}, + {name: 'Chinese Traditional', code: 'zh-TW', original: '中文繁體'}, + {name: 'English', code: 'en', original: 'English'}, + {name: 'French', code: 'fr', original: 'Française'}, + {name: 'German', code: 'de', original: 'Deutsch'}, + {name: 'Hindi', code: 'hi', original: 'हिंदी'}, + {name: 'Hungarian', code: 'hu', original: 'Magyar'}, + {name: 'Italian', code: 'it', original: 'Italiano'}, + {name: 'Japanese', code: 'ja', original: '日本語'}, + {name: 'Kannada', code: 'kn', original: 'ಕನ್ನಡ'}, + {name: 'Korean', code: 'ko', original: '한국어'}, + {name: 'Malayalam', code: 'ml-IN', original: 'മലയാളം'}, + {name: 'Persian', code: 'fa', original: 'فارسی'}, + {name: 'Polish', code: 'pl', original: 'Polski'}, + {name: 'Portuguese', code: 'pt-PT', original: 'Português'}, + {name: 'Portuguese (Brazil)', code: 'pt-BR', original: 'Português (Brasil)'}, + {name: 'Russian', code: 'ru', original: 'Русский'}, + {name: 'Spanish', code: 'es-ES', original: 'Español'}, + {name: 'Telugu', code: 'te', original: 'తెలుగు'}, + {name: 'Turkish', code: 'tr', original: 'Türk'}, + {name: 'Ukrainian', code: 'uk', original: 'Українська'}, +]; + const config = { platform: process.platform, - languages: [ - 'de', - 'en', - 'es-ES', - 'fa', - 'hi', - 'hu', - 'it', - 'ja', - 'ko', - 'kn', - 'ml-IN', - 'pa-IN', - 'pl', - 'pt-BR', - 'pt-PT', - 'ru', - 'te', - 'uk', - 'zh-CN', - ], + languages: languageList.map((language) => language.code), fallbackLng: 'en', namespace: 'translation', }; @@ -42,4 +47,4 @@ function getI18NextOptions(backend) { } export default config; -export {getI18NextOptions}; +export {languageList, getI18NextOptions}; diff --git a/app/main/menus.js b/app/main/menus.js index 761f2c2722..d095658f6c 100644 --- a/app/main/menus.js +++ b/app/main/menus.js @@ -1,6 +1,6 @@ import {Menu, app, dialog, shell} from 'electron'; -import config from '../configs/app.config'; +import config, {languageList} from '../configs/app.config'; import i18n from '../configs/i18next.config'; import {checkNewUpdates} from './auto-updater'; import {APPIUM_SESSION_EXTENSION} from './helpers'; @@ -9,11 +9,11 @@ import {launchNewSessionWindow} from './windows'; let menuTemplates = {mac: {}, other: {}}; function languageMenu() { - return config.languages.map((languageCode) => ({ - label: i18n.t(languageCode), + return languageList.map((language) => ({ + label: `${language.name} (${language.original})`, type: 'radio', - checked: i18n.language === languageCode, - click: () => i18n.changeLanguage(languageCode), + checked: i18n.language === language.code, + click: () => i18n.changeLanguage(language.code), })); } diff --git a/assets/locales/en/translation.json b/assets/locales/en/translation.json index 208ec2f001..1d5bb681f9 100644 --- a/assets/locales/en/translation.json +++ b/assets/locales/en/translation.json @@ -1,23 +1,4 @@ { - "en": "English", - "de": "Deutsch", - "ru": "Русский", - "ja": "日本語", - "zh-CN": "中文", - "ko": "한국어", - "hi": "हिंदी", - "hu": "Magyar", - "kn": "ಕನ್ನಡ", - "ml-IN": "മലയാളം", - "pa-IN": "ਪੰਜਾਬੀ", - "te": "తెలుగు", - "pt-BR": "Português (Brasil)", - "pt-PT": "Português (Portugal)", - "it": "Italiano", - "es-ES": "Español", - "pl": "Polski", - "fa": "فارسی", - "uk": "Українська", "appiumInspector": "Appium Inspector", "Edit": "Edit", "Redo": "Redo",