除个别外语法错误整体修正

This commit is contained in:
bgArray
2022-01-19 13:32:53 +08:00
parent 07e153f215
commit 7e13b22d46
10 changed files with 666 additions and 586 deletions

View File

@ -9,7 +9,7 @@
# 若需转载或借鉴 请附作者
'''
"""
Copyright 2022 Eilles Wan (金羿)
Licensed under the Apache License, Version 2.0 (the 'License')
@ -23,21 +23,33 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
'''
"""
# 代码写的并非十分的漂亮还请大佬多多包涵本软件源代码依照Apache软件协议公开
'''
将程序中用双引号""括起来的字符串
转为字符串列表 list[str, str, ...]
方便进行语言翻译支持。
'''
# -----------------------------分割线-----------------------------
# 诸葛亮与八卦阵帮忙修改语法 日期:---2022年1月19日
# 统计致命三级错误0个警告二级错误0个语法一级错误12个
# 目前我的Pycharm并没有显示任何错误有错误可以向
# bgArray 诸葛亮与八卦阵
# QQ 474037765 或最好加入:音·创 开发交流群 861684859
# ------------------------- split line-----------------------------
# Zhuge Liang and Bagua array help to modify the grammar date: -- January 19, 2022
# Statistics: fatal (Level 3) errors: 0; Warning (Level 2) errors: 15; Syntax (Level 1) error: 597
# At present, my Pycham does not display any errors. If there are errors, you can report them to me
# Bgarray Zhuge Liang and Bagua array
# QQ 474037765 or better join: Musicreater development exchange group 861684859
# ------------------------- split line-----------------------------
startWith = 0
# 下面为正文
# 将程序中用双引号""括起来的字符串
# 转为字符串列表 list[str, str, ...]
# 方便进行语言翻译支持。
import sys
startWith = 0
def __main__():
@ -46,23 +58,25 @@ def __main__():
print('读取文件: {}'.format(fileName))
fileText = []
for line in open(fileName, 'r', encoding='utf-8'):
while line.count('"') >=2:
while 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('"')])])
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('"')])])
textList.append(
line[line.index('"'):2 + line[line.index('"') + 1:].index('"') + len(line[:line.index('"')])])
line = line.replace(
line[line.index('"'):2+line[line.index('"') + 1:].index('"')+len(line[:line.index('"')])],
'READABLETEXT[{}]'.format(thisText+startWith)
line[line.index('"'):2 + line[line.index('"') + 1:].index('"') + len(line[:line.index('"')])],
'READABLETEXT[{}]'.format(thisText + startWith)
)
fileText.append(line)
open(fileName+'_C','w',encoding='utf-8').writelines(fileText)
outFile = open('lang__.py','w',encoding='utf-8')
open(fileName + '_C', 'w', encoding='utf-8').writelines(fileText)
outFile = open('lang__.py', 'w', encoding='utf-8')
outFile.write('''# -*- coding:utf-8 -*-
# 由金羿翻译工具生成字符串列表
@ -73,7 +87,7 @@ def __main__():
READABLETEXT = {
''')
for i in range(len(textList)):
outFile.write(" {}:{},\n".format(i+startWith,textList[i]))
outFile.write(" {}:{},\n".format(i + startWith, textList[i]))
outFile.write('}')
outFile.close()

View File

@ -4,160 +4,159 @@
# 请在所需翻译的文件前from 此文件 import READABLETEXT
READABLETEXT = {
'Translator':(("Eilles Wan (金羿)",True),),
'Translator': (("Eilles Wan (金羿)", True),),
# 此处是语言翻译者列表,其中每个元组第一项为显示文本,第二项为此文本是否为开发者名字
0:"ERROR❌",
1:"TIPS❗",
2:"Clearing log(this wont be in the file)",
3:"Could not clear the temporary files or logs",
4:"saved",
5:"New Musicreater Project",
6:"Select old-type project",
7:"Select Musicreater Project",
8:"Cant open:{}, please check if youve entered the right name",
9:"Musicreat - About",
10:"Musicreater",
11:"Ver. {}",
12:"""Team-Ryoun for Minecraft\n×\nTeam-Ryoun for Software Development""",
13:"OK",
14:"Inpute Notes",
15:(("- Developers -",False),
("Eilles Wan (金羿)",True),("EillesWan@outlook.com",False),("QQ 2647547478",False),
("bgArray “诸葛亮与八卦阵”",True),("QQ 474037765",False)),
0: "ERROR❌",
1: "TIPS❗",
2: "Clearing log(this wont be in the file)",
3: "Could not clear the temporary files or logs",
4: "saved",
5: "New Musicreater Project",
6: "Select old-type project",
7: "Select Musicreater Project",
8: "Cant open:{}, please check if youve entered the right name",
9: "Musicreat - About",
10: "Musicreater",
11: "Ver. {}",
12: """Team-Ryoun for Minecraft\n×\nTeam-Ryoun for Software Development""",
13: "OK",
14: "Inpute Notes",
15: (("- Developers -", False),
("Eilles Wan (金羿)", True), ("EillesWan@outlook.com", False), ("QQ 2647547478", False),
("bgArray “诸葛亮与八卦阵”", True), ("QQ 474037765", False)),
# 此处是开发者列表,其中每个元组第一项为显示文本,第二项为此文本是否为开发者名字
16:"- Translators -",
16: "- Translators -",
# 17:"",
18:"QQ Group: 861684859",
19:"Musicreater - Help",
20:"Select sound file",
21:"Select MIDI file",
22:"Select NoteText file",
23:"Get Note info",
24:"Write in Note info: {}",
25:"Select generating file",
26:"Select generating folder",
27:"Select generating .mcpack file",
28:"Input position info",
29:"Select generating world folder",
30:"Select generating Function Pack",
31:"Select .mcfunction file ",
32:"Select .bdx file ",
33:"DONE✔",
34:"Input playing rate",
35:"Generating",
36:"Select a world folder",
37:"Make sure",
38:"Generate .RyStruct file",
39:"FAILED❌",
40:"Report message inpution",
41:"Musicreater - Eilles - {}",
42:"ExecutingEntityName: {}",
43:"ScoreboardName: {}",
44:"Instrument: {}",
45:"TrackName: {}",
46:"PackName: {}",
47:"MusicTitle: {}",
48:"IsRepeat?: {}",
49:"Player'sTargetSelector: {}",
50:"Modify Main Option",
51:"Modify Track Option",
52:"Default Instrument: Enter English\n",
53:"Open...",
54:"Open Old Project...",
55:"Save",
56:"Save as...",
57:"Exit",
58:"File",
59:"Load tracks from sound",
60:"Load tracks from Midi",
61:"Load tracks from Text",
62:"Input notes to track",
63:"Edit",
64:"Generate file...",
65:"Generate function pack...",
66:"Generate .mcpack file...",
67:"Functions(Pack)",
68:"Save music as blocks into a map",
69:"Save music as blocks into a exist map...",
70:"Save music as commands into a map",
71:"Save music as commands into a exist map...",
72:"Save music as notebox into a map",
73:"Save music as notebox into a exist map...",
74:"World",
75:"Generate a function that fits current music...",
76:"Save selected track as commands in .bdx file...",
77:"Export .bdx file from map...",
78:"Export .RyStruct file from map...",
79:"Load functions into a world...",
80:"Separate long .mcfunction file into small ones and set them into a world as a chain...",
81:"Additional Functions",
82:"Show generating result",
83:"Set a websocket server on localhost:8080 and play the selected track",
84:"Experimental Functions",
85:"Clear log file",
86:"Clear save file(obsolete)",
87:"Help",
88:"About",
89:"Send a bug report",
90:"Q&A",
91:"Main Options",
18: "QQ Group: 861684859",
19: "Musicreater - Help",
20: "Select sound file",
21: "Select MIDI file",
22: "Select NoteText file",
23: "Get Note info",
24: "Write in Note info: {}",
25: "Select generating file",
26: "Select generating folder",
27: "Select generating .mcpack file",
28: "Input position info",
29: "Select generating world folder",
30: "Select generating Function Pack",
31: "Select .mcfunction file ",
32: "Select .bdx file ",
33: "DONE✔",
34: "Input playing rate",
35: "Generating",
36: "Select a world folder",
37: "Make sure",
38: "Generate .RyStruct file",
39: "FAILED❌",
40: "Report message inpution",
41: "Musicreater - Eilles - {}",
42: "ExecutingEntityName: {}",
43: "ScoreboardName: {}",
44: "Instrument: {}",
45: "TrackName: {}",
46: "PackName: {}",
47: "MusicTitle: {}",
48: "IsRepeat?: {}",
49: "Player'sTargetSelector: {}",
50: "Modify Main Option",
51: "Modify Track Option",
52: "Default Instrument: Enter English\n",
53: "Open...",
54: "Open Old Project...",
55: "Save",
56: "Save as...",
57: "Exit",
58: "File",
59: "Load tracks from sound",
60: "Load tracks from Midi",
61: "Load tracks from Text",
62: "Input notes to track",
63: "Edit",
64: "Generate file...",
65: "Generate function pack...",
66: "Generate .mcpack file...",
67: "Functions(Pack)",
68: "Save music as blocks into a map",
69: "Save music as blocks into a exist map...",
70: "Save music as commands into a map",
71: "Save music as commands into a exist map...",
72: "Save music as notebox into a map",
73: "Save music as notebox into a exist map...",
74: "World",
75: "Generate a function that fits current music...",
76: "Save selected track as commands in .bdx file...",
77: "Export .bdx file from map...",
78: "Export .RyStruct file from map...",
79: "Load functions into a world...",
80: "Separate long .mcfunction file into small ones and set them into a world as a chain...",
81: "Additional Functions",
82: "Show generating result",
83: "Set a websocket server on localhost:8080 and play the selected track",
84: "Experimental Functions",
85: "Clear log file",
86: "Clear save file(obsolete)",
87: "Help",
88: "About",
89: "Send a bug report",
90: "Q&A",
91: "Main Options",
# 92:"",
# 93:"",
# 94:"",
# 95:"",
96:"Reset Main Options",
97:"Track Options",
96: "Reset Main Options",
97: "Track Options",
# 98:"",
# 99:"",
# 100:"",
# 101:"",
102:"Delete Selected Track",
102: "Delete Selected Track",
# 103:"",
# 104:"",
105:"找不到或无法读取文件😢:{}",
106:"您当前的项目已修改但未存储,是否先保存当前项目?",
107:"项目已经存储至:{}",
108:"音·创工程文件",
109:"任意类型",
110:"函数音创工程文件",
111:"MMFM0.0.6版本工程文件",
112:"全部类型",
113:"钢琴声音的音频文件",
114:"Midi文件",
115:"文本文件",
116:"请输入坐标:",
117:"您输入的格式有误,请重新输入!",
118:"我的世界指令函数文件",
119:"请输入执行链生成坐标:",
120:"您输入的格式有误,请重新输入。",
121:"您的函数文件不大于一万条指令,无需进行分割操作。",
122:"请输入执行链生成相对坐标:",
123:"FastBuilder结构文件",
124:"转换结束!\n{}",
125:"一秒,音乐走几拍?",
126:"按下确认后在游戏中使用connect指令连接localhost:8080即可播放",
127:"请输入区域选择的开始坐标:",
128:"请输入区域选择的结束坐标:",
129:"所选区块导出时是否需要保留空气方块?",
130:"音·创结构文件",
131:"文件已生成\n{}",
132:"文件无法生成\n{}\n{}",
133:"本功能尚未开发。",
134:"您的称呼",
135:"您的联系方式",
136:"您对问题的描述",
137:"在程序结束后将清除日志及临时文件信息。",
138:"在程序结束后将不会清除日志及临时文件信息。",
139:"修改包名",
140:"修改音乐标题",
141:"修改玩家选择器\n注意!要加上中括号“[]”",
142:"修改本音轨的执行实体名",
143:"修改本音轨所用的积分板",
144:"修改本音轨所用乐器",
145:"您输入的乐器并非游戏内置乐器,是否继续用您输入的字符作为乐器?",
146:"修改本音轨生成的文件名",
105: "找不到或无法读取文件😢:{}",
106: "您当前的项目已修改但未存储,是否先保存当前项目?",
107: "项目已经存储至:{}",
108: "音·创工程文件",
109: "任意类型",
110: "函数音创工程文件",
111: "MMFM0.0.6版本工程文件",
112: "全部类型",
113: "钢琴声音的音频文件",
114: "Midi文件",
115: "文本文件",
116: "请输入坐标:",
117: "您输入的格式有误,请重新输入!",
118: "我的世界指令函数文件",
119: "请输入执行链生成坐标:",
120: "您输入的格式有误,请重新输入。",
121: "您的函数文件不大于一万条指令,无需进行分割操作。",
122: "请输入执行链生成相对坐标:",
123: "FastBuilder结构文件",
124: "转换结束!\n{}",
125: "一秒,音乐走几拍?",
126: "按下确认后在游戏中使用connect指令连接localhost:8080即可播放",
127: "请输入区域选择的开始坐标:",
128: "请输入区域选择的结束坐标:",
129: "所选区块导出时是否需要保留空气方块?",
130: "音·创结构文件",
131: "文件已生成\n{}",
132: "文件无法生成\n{}\n{}",
133: "本功能尚未开发。",
134: "您的称呼",
135: "您的联系方式",
136: "您对问题的描述",
137: "在程序结束后将清除日志及临时文件信息。",
138: "在程序结束后将不会清除日志及临时文件信息。",
139: "修改包名",
140: "修改音乐标题",
141: "修改玩家选择器\n注意!要加上中括号“[]”",
142: "修改本音轨的执行实体名",
143: "修改本音轨所用的积分板",
144: "修改本音轨所用乐器",
145: "您输入的乐器并非游戏内置乐器,是否继续用您输入的字符作为乐器?",
146: "修改本音轨生成的文件名",
}
}

View File

@ -23,9 +23,9 @@ READABLETEXT = {
13: "确定",
14: "请输入音符",
15: (("- 开发者 -", False),
("金羿 Eilles", True), ("EillesWan@outlook.com", False), ("QQ 2647547478", False),
("bgArray “诸葛亮与八卦阵”",True),("QQ 474037765",False),
),
("金羿 Eilles", True), ("EillesWan@outlook.com", False), ("QQ 2647547478", False),
("bgArray “诸葛亮与八卦阵”", True), ("QQ 474037765", False),
),
# 此处是开发者列表,其中每个元组第一项为显示文本,第二项为此文本是否为开发者名字
16: "- 翻译者 -",
# 17:"",