mirror of
https://github.com/TriM-Organization/Musicreater.git
synced 2025-09-05 11:56:23 +00:00
新增多语言支持。
This commit is contained in:
0
languages/__init__.py
Normal file
0
languages/__init__.py
Normal file
BIN
languages/__pycache__/lang.cpython-38.pyc
Normal file
BIN
languages/__pycache__/lang.cpython-38.pyc
Normal file
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
#-*- coding:utf-8 -*-
|
||||
# -*- coding:utf-8 -*-
|
||||
|
||||
|
||||
# W-YI 金羿
|
||||
@ -17,9 +17,47 @@
|
||||
方便进行语言翻译支持。
|
||||
'''
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
def __main__():
|
||||
pass
|
||||
textList = []
|
||||
for fileName in sys.argv[1:]:
|
||||
print('读取文件: {}'.format(fileName))
|
||||
fileText = []
|
||||
for line in open(fileName, 'r', encoding='utf-8'):
|
||||
if line.count('"') >=2:
|
||||
# 只有上帝看得懂我在写什么。
|
||||
if line[line.index('"'):2+line[line.index('"')+1:].index('"')+len(line[:line.index('"')])] in textList:
|
||||
thisText = textList.index(line[line.index('"'):2+line[line.index('"')+1:].index('"')+len(line[:line.index('"')])])
|
||||
else:
|
||||
thisText = len(textList)
|
||||
textList.append(line[line.index('"'):2+line[line.index('"')+1:].index('"')+len(line[:line.index('"')])])
|
||||
fileText.append(line.replace(
|
||||
line[line.index('"'):2+line[line.index('"')+1:].index('"')+len(line[:line.index('"')])],
|
||||
'READABLETEXT[{}]'.format(thisText)
|
||||
))
|
||||
else:
|
||||
fileText.append(line)
|
||||
|
||||
open(fileName+'_C','w',encoding='utf-8').writelines(fileText)
|
||||
|
||||
|
||||
outFile = open('lang.py','w',encoding='utf-8')
|
||||
outFile.write('''# -*- coding:utf-8 -*-
|
||||
|
||||
# 由金羿翻译工具生成字符串列表
|
||||
# 请在所需翻译文件前from 此文件 import READABLETEXT
|
||||
|
||||
|
||||
|
||||
READABLETEXT = {
|
||||
''')
|
||||
for i in range(len(textList)):
|
||||
outFile.write(" {}:{},\n".format(i,textList[i]))
|
||||
outFile.write('}')
|
||||
outFile.close()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
__main__
|
||||
__main__()
|
||||
|
113
languages/lang.py
Normal file
113
languages/lang.py
Normal file
@ -0,0 +1,113 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
|
||||
# 由金羿翻译工具生成字符串列表
|
||||
# 请在所需翻译文件前from 此文件 import READABLETEXT
|
||||
|
||||
|
||||
|
||||
READABLETEXT = {
|
||||
0:"错误❌",
|
||||
1:"提示❗",
|
||||
2:"清除log(此句不载入日志)",
|
||||
3:"无法清除日志及临时文件",
|
||||
4:"已存储",
|
||||
5:"新建 音·创 项目",
|
||||
6:"请选择旧类型的项目",
|
||||
7:"请选择 音·创 项目",
|
||||
8:"无法打开文件:{},请查看您是否输入正确",
|
||||
9:"音·创 - 关于",
|
||||
10:"我的世界音·创",
|
||||
11:"当前版本:{}",
|
||||
12:"凌云我的世界开发团队",
|
||||
13:"×",
|
||||
14:"凌云软件开发团队",
|
||||
15:"唯一开发者:金羿(W-YI)",
|
||||
16:"Email: EillesWan@outlook.com",
|
||||
17:"QQ: 2647547478",
|
||||
18:"讨论群: 861684859",
|
||||
19:"音·创 - 帮助",
|
||||
20:"请选择钢琴声音的 MP3 文件",
|
||||
21:"请选择 MIDI 文件",
|
||||
22:"请选择 音符文本 文件",
|
||||
23:"获取信息",
|
||||
24:"音符数据写入{}",
|
||||
25:"请选择文件生成的位置",
|
||||
26:"请选择文件夹生成的位置",
|
||||
27:"请选择.mcpack文件生成的位置",
|
||||
28:"坐标信息输入",
|
||||
29:"请选择世界文件夹生成的位置",
|
||||
30:"请选择函数包生成的位置",
|
||||
31:"请选择 .mcfunction 文件",
|
||||
32:"请选择需要生成的.bdx文件",
|
||||
33:"完成!✔",
|
||||
34:"输入播放速度",
|
||||
35:"创建中",
|
||||
36:"请选择世界文件夹所在的位置",
|
||||
37:"请确认",
|
||||
38:"生成.RyStruct文件",
|
||||
39:"失败❌",
|
||||
40:"邮件反馈信息输入",
|
||||
41:"音·创 - 金羿 - {}",
|
||||
42:"执行实体名:{}",
|
||||
43:"使用计分板:{}",
|
||||
44:"所用的乐器:{}",
|
||||
45:"当前音轨名:{}",
|
||||
46:"包名:{}",
|
||||
47:"音乐标题:{}",
|
||||
48:"是否重复:{}",
|
||||
49:"玩家选择器:{}",
|
||||
50:"修改主设置",
|
||||
51:"修改节设置",
|
||||
52:"游戏内置乐器如下:请输入英文\n",
|
||||
53:"打开音·创项目...",
|
||||
54:"打开旧项目...",
|
||||
55:"保存项目",
|
||||
56:"另存为...",
|
||||
57:"退出",
|
||||
58:"文件",
|
||||
59:"从钢琴MP3导入音轨",
|
||||
60:"从midi导入音轨",
|
||||
61:"从文本文件导入音轨",
|
||||
62:"输入音符至音轨",
|
||||
63:"编辑",
|
||||
64:"生成文件至...",
|
||||
65:"生成函数包至...",
|
||||
66:"生成附加包文件至...",
|
||||
67:"函数(包)",
|
||||
68:"将音乐以方块存储生成地图",
|
||||
69:"将音乐以方块存储载入地图…",
|
||||
70:"将音乐以指令存储生成地图",
|
||||
71:"将音乐以指令存储载入地图…",
|
||||
72:"将音乐以音符盒存储生成地图",
|
||||
73:"将音乐以音符盒存储载入地图…",
|
||||
74:"世界",
|
||||
75:"生成符合当前音乐的函数播放器…",
|
||||
76:"将选中音轨以指令存储生成.bdx文件…",
|
||||
77:"由地图导出至.bdx文件…",
|
||||
78:"由地图导出至.RyStruct文件…",
|
||||
79:"将函数载入世界…",
|
||||
80:"将大函数分割并建立执行链…",
|
||||
81:"辅助功能",
|
||||
82:"展示生成结果",
|
||||
83:"建立位于localhost:8080上的websocket服务器播放选中音轨",
|
||||
84:"实验功能",
|
||||
85:"清除临时文件",
|
||||
86:"清除存在文件",
|
||||
87:"帮助",
|
||||
88:"关于",
|
||||
89:"发送错误日志反馈",
|
||||
90:"帮助与疑问",
|
||||
91:"音乐总设置(项目设置)",
|
||||
92:"地图/函数包名:",
|
||||
93:"音乐标题:",
|
||||
94:"是否重复:",
|
||||
95:"玩家选择器:",
|
||||
96:"重置项目设置",
|
||||
97:"当前音轨设置(段落设置)",
|
||||
98:"执行实体名:",
|
||||
99:"使用计分板:",
|
||||
100:"所用的乐器:",
|
||||
101:"当前音轨名:",
|
||||
102:"删除选中音轨",
|
||||
|
||||
}
|
Reference in New Issue
Block a user