diff --git a/languages/lang.py b/languages/lang.py index 8f92190..e7dc526 100644 --- a/languages/lang.py +++ b/languages/lang.py @@ -1,20 +1,64 @@ # -*- coding:utf-8 -*- - +'''对于音·创的语言支持兼语言文件编辑器''' DEFAULTLANGUAGE = 'zh-CN' LANGUAGELIST = { + # 第一个是语言的中文名称和地区 + # 第二个是语言的英文名称和地区 + # 第三个是语言的本地名称和地区 'zh-CN': ( "简体中文 中国大陆", - "Simplified Chinese, China Mainland", + "Simplified Chinese, Chinese Mainland", + "简体中文 中国大陆", ), + 'zh-TW': ( + "繁体中文 台湾省", + "Traditional Chinese, Taiwan Province", + "正體中文,台灣省", + ), + # 'zh-HK': ( + # "简体中文 中国大陆", + # "Traditional Chinese, the Hong Kong Special Administrative Region", + # "繁體中文,香港特別行政區", + # ), + # 'zh-MO': ( + # "简体中文 中国大陆", + # "Traditional Chinese, the Macao Special Administrative Region", + # "繁體中文,澳門特別行政區", + # ), 'en-GB': ( - "英式英语 大不列颠", - "British English, Great Britain", + "英语 英国", + "British English, the United Kingdom", + "British English, the United Kingdom", ), } -if DEFAULTLANGUAGE == 'zh-CN': - from languages.zhCN import READABLETEXT -elif DEFAULTLANGUAGE == 'en-GB': - from languages.enGB import READABLETEXT +# 对于旧版本音·创的语言支持 +# 重构之后将停止使用 +from languages.zhCN import READABLETEXT + +if DEFAULTLANGUAGE in LANGUAGELIST.keys(): + with open('./languages/'+DEFAULTLANGUAGE+'.lang','r',encoding='utf-8') as languageFile : + _text = [] + for line in languageFile: + _text.append(line) + _TEXT = _text.copy() +else: + raise KeyError(f"无法打开默认语言{DEFAULTLANGUAGE}") + + + + +if __name__ == '__main__': + # 启动语言编辑器 + import tkinter as tk + + root = tk.Tk() + + root.geometry('900x600') + + + + + diff --git a/languages/zh-CN.lang b/languages/zh-CN.lang new file mode 100644 index 0000000..e69de29 diff --git a/msctLib/UI设计图.pdn b/msctLib/UI设计图.pdn index 48d702f..6ff3a9c 100644 Binary files a/msctLib/UI设计图.pdn and b/msctLib/UI设计图.pdn differ diff --git a/msctLib/UI设计图.png b/msctLib/UI设计图.png index 00a5e63..9ccf849 100644 Binary files a/msctLib/UI设计图.png and b/msctLib/UI设计图.png differ diff --git a/msctLib/display.py b/msctLib/display.py index f116432..9e8adfd 100644 --- a/msctLib/display.py +++ b/msctLib/display.py @@ -71,6 +71,8 @@ class disp: self.setTitle(title,debug) self.setGeometry(geometry,debug) self.setIcon(*iconbitmap,debug=debug) + + self.setMenu(menuWidget) self.initWidget(wordView,buttons,settingBox,notemap) @@ -175,6 +177,47 @@ class disp: +def authorMenu(authors:tuple = (('金羿','EillesWan@outlook.com'),('诸葛亮与八卦阵','474037765'))): + '''自定义作者界面''' + from languages.lang import + aabw = tk.Tk() + aabw.title(READABLETEXT[9]) + aabw.geometry('550x600') # 像素 + tk.Label(aabw, text='', font=('', 15)).pack() + tk.Label(aabw, text=READABLETEXT[10], font=('', 35)).pack() + tk.Label(aabw, text=READABLETEXT[11].format(VER[1] + VER[0]), font=('', 15)).pack() + # pack 的side可以赋值为LEFT RTGHT TOP BOTTOM + # grid 的row 是列数、column是行排,注意,这是针对空间控件本身大小来的,即是指向当前控件的第几个。 + # place的 x、y是(x,y)坐标 + # pic = tk.PhotoImage(file='./bin/pics/Ryoun_S.png') + # tk.Label(aabw, image=pic, width=200, height=200).pack() + # del pic + tk.Label(aabw, text='', font=('', 5)).pack() + tk.Label(aabw, text=READABLETEXT[12], font=('', 20)).pack() + tk.Label(aabw, text='', font=('', 15)).pack() + for i in READABLETEXT[15]: + tk.Label(aabw, text=i[0], font=('', 17 if i[1] else 15, 'bold' if i[1] else '')).pack() + tk.Label(aabw, text='', font=('', 5)).pack() + if DEFAULTLANGUAGE != 'zh-CN': + tk.Label(aabw, text=READABLETEXT[16], font=('', 15)).pack() + for i in READABLETEXT['Translator']: + tk.Label(aabw, text=i[0], font=('', 17 if i[1] else 15, 'bold' if i[1] else '')).pack() + + def exitAboutWindow(): + aabw.destroy() + + tk.Button(aabw, text=READABLETEXT[13], command=exitAboutWindow).pack() + + aabw.mainloop() + + + + + + + + + class ProgressBar: def __init__(self,root:tk.Tk = tk.Tk(),style:tuple = (DEFAULTBLUE,BLACK,WHITE),