Refactor language translations in config_launcher.py for improved readability

master
Yong-Jer Chuang 2024-04-26 14:33:50 +08:00
parent d35c3bea32
commit fe1918adfd
1 changed files with 77 additions and 93 deletions

View File

@ -40,99 +40,83 @@ URL_FIREFOX_DRIVER = 'https://github.com/mozilla/geckodriver/releases'
URL_EDGE_DRIVER = 'https://developer.microsoft.com/zh-tw/microsoft-edge/tools/webdriver/' URL_EDGE_DRIVER = 'https://developer.microsoft.com/zh-tw/microsoft-edge/tools/webdriver/'
def load_translate(): def load_translate():
translate = {} translate = {
en_us={} 'en_us': {
en_us["language"] = 'Language' "language": 'Language',
en_us["enable"] = 'Enable' "enable": 'Enable',
"config_list": 'Config List',
en_us["config_list"] = 'Config List' "advanced": 'Advanced',
en_us["advanced"] = 'Advanced' "about": 'About',
en_us["about"] = 'About' "run": 'Run',
"browse": 'Browse...',
en_us["run"] = 'Run' "save": 'Save',
en_us["browse"] = 'Browse...' "exit": 'Close',
en_us["save"] = 'Save' "copy": 'Copy',
en_us["exit"] = 'Close' "restore_defaults": 'Restore Defaults',
en_us["copy"] = 'Copy' "done": 'Done',
en_us["restore_defaults"] = 'Restore Defaults' "maxbot_slogan": 'MaxRegBot is a FREE and open source bot program. Wish you good luck.',
en_us["done"] = 'Done' "donate": 'Donate',
"help": 'Help',
en_us["maxbot_slogan"] = 'MaxRegBot is a FREE and open source bot program. Wish you good luck.' "release": 'Release'
en_us["donate"] = 'Donate' },
en_us["help"] = 'Help' 'zh_tw': {
en_us["release"] = 'Release' "language": '語言',
"enable": '啟用',
zh_tw={} "config_list": '設定檔管理',
zh_tw["language"] = '語言' "advanced": '進階設定',
zh_tw["enable"] = '啟用' "autofill": '自動填表單',
"about": '關於',
zh_tw["config_list"] = '設定檔管理' "run": '搶票',
zh_tw["advanced"] = '進階設定' "browse": '開啟...',
zh_tw["autofill"] = '自動填表單' "save": '存檔',
zh_tw["about"] = '關於' "exit": '關閉',
"copy": '複製',
zh_tw["run"] = '搶票' "restore_defaults": '恢復預設值',
zh_tw["browse"] = '開啟...' "done": '完成',
zh_tw["save"] = '存檔' "maxbot_slogan": 'MaxRegBot是一個免費、開放原始碼的搶票機器人。\n祝您掛號成功。',
zh_tw["exit"] = '關閉' "donate": '打賞',
zh_tw["copy"] = '複製' "release": '所有可用版本',
zh_tw["restore_defaults"] = '恢復預設值' "help": '使用教學'
zh_tw["done"] = '完成' },
'zh_cn': {
zh_tw["maxbot_slogan"] = 'MaxRegBot是一個免費、開放原始碼的搶票機器人。\n祝您掛號成功。' "language": '语言',
zh_tw["donate"] = '打賞' "enable": '启用',
zh_tw["release"] = '所有可用版本' "config_list": '设定档管理',
zh_tw["help"] = '使用教學' "advanced": '進階設定',
"autofill": '自动填表单',
zh_cn={} "about": '关于',
zh_cn["language"] = '语言' "run": '抢票',
zh_cn["enable"] = '启用' "browse": '开启...',
"save": '存档',
zh_cn["config_list"] = '设定档管理' "exit": '关闭',
zh_cn["advanced"] = '進階設定' "copy": '复制',
zh_cn["autofill"] = '自动填表单' "restore_defaults": '恢复默认值',
zh_cn["about"] = '关于' "done": '完成',
zh_cn["copy"] = '复制' "maxbot_slogan": 'MaxRegBot 是一个免费的开源机器人程序。\n祝您挂号成功。',
"donate": '打赏',
zh_cn["run"] = '抢票' "help": '使用教学',
zh_cn["browse"] = '开启...' "release": '所有可用版本'
zh_cn["save"] = '存档' },
zh_cn["exit"] = '关闭' 'ja_jp': {
zh_cn["copy"] = '复制' "language": '言語',
zh_cn["restore_defaults"] = '恢复默认值' "enable": '有効',
zh_cn["done"] = '完成' "config_list": 'Config List',
"advanced": '高度な設定',
zh_cn["maxbot_slogan"] = 'MaxRegBot 是一个免费的开源机器人程序。\n祝您挂号成功。' "autofill": 'オートフィル',
zh_cn["donate"] = '打赏' "about": '情報',
zh_cn["help"] = '使用教学' "run": 'チケットを取る',
zh_cn["release"] = '所有可用版本' "browse": '開ける...',
"save": '保存',
ja_jp={} "exit": '閉じる',
ja_jp["language"] = '言語' "copy": 'コピー',
ja_jp["enable"] = '有効' "restore_defaults": 'デフォルトに戻す',
"done": '終わり',
ja_jp["config_list"] = 'Config List' "maxbot_slogan": 'MaxRegBot は無料のオープン ソース ボット プログラムです。チケットの成功をお祈りします。',
ja_jp["advanced"] = '高度な設定' "donate": '寄付',
ja_jp["autofill"] = 'オートフィル' "help": '利用方法',
ja_jp["about"] = '情報' "release": 'リリース'
}
ja_jp["run"] = 'チケットを取る' }
ja_jp["browse"] = '開ける...'
ja_jp["save"] = '保存'
ja_jp["exit"] = '閉じる'
ja_jp["copy"] = 'コピー'
ja_jp["restore_defaults"] = 'デフォルトに戻す'
ja_jp["done"] = '終わり'
ja_jp["maxbot_slogan"] = 'MaxRegBot は無料のオープン ソース ボット プログラムです。チケットの成功をお祈りします。'
ja_jp["donate"] = '寄付'
ja_jp["help"] = '利用方法'
ja_jp["release"] = 'リリース'
translate['en_us']=en_us
translate['zh_tw']=zh_tw
translate['zh_cn']=zh_cn
translate['ja_jp']=ja_jp
return translate return translate
def get_default_config(): def get_default_config():