Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
LiarOnce committed Jun 7, 2024
2 parents 9d9db00 + e2abb85 commit 9fc3c1f
Show file tree
Hide file tree
Showing 16 changed files with 88 additions and 32 deletions.
41 changes: 28 additions & 13 deletions GameMakerManualTranslatorBuild-Project/res/build.aardio
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ if setting.group{
group="def"
}


//生成导入依赖的html
importHtml=""
//依赖js
Expand All @@ -31,16 +30,26 @@ if setting.group{
console.log("import:",p)
}
},);
//依赖json和global json
importHtml+=//<script type="text/javascript" src="{json}"></script>
importHtml+=//<script type="text/javascript" src="{global}"></script>


//设置路径
path_manual = path+"GMS2-Robohelp-en/"
path_build = path+"build/"
path_language = path+"language/"+group+"/"



//读取模板与全局内容
var template=string.load(path+"/patch/template.htm")
var json_global=string.load(fsys.path.canonicalize(path_language+"/global.json"))

//将全局json储存
if !json_global json_global="{}"
json_global="json_global="+json_global
string.save(fsys.path.canonicalize(path+"/build/assets/import/language/global.js"),json_global)

//将内容注入文档
fsys.enum(path_manual,"*.htm",function(dirname,filename,fullpath,findData){
Expand All @@ -52,23 +61,30 @@ fsys.enum(path_manual,"*.htm",function(dirname,filename,fullpath,findData){
//文档原html
var html=string.load(fullpath)

var path_base=string.match(html,'src="(.*?)template/scripts')
var path_base=string.match(html,'src="(.*?)template/scripts')//基础路径

//获取json文本
var json=string.load(fsys.path.canonicalize(path_language+"/www/"+p+".json"))
if !json json="{}"
json="json="+json
//保存json文本
string.save(fsys.path.canonicalize(path+"/build/assets/import/language/"+p+".js"),json)

//替换原文档基础路径
var tmp_template=string.replace(template,"@{path}",path_base)

var tmp_importHtml=string.replace(importHtml,"@{path}",path_base+"assets\import")
var tmp_importHtml=string.replace(tmp_importHtml,"@{global}",path_base+"assets\import\language\global.js")
var tmp_importHtml=string.replace(tmp_importHtml,"@{json}",path_base+"assets\import\language"+p+".js")

//替换基础路径
var tmp=string.replace(template,"@{path}",path_base)
//替换字典
var tmp=string.replace(tmp,"@{global}",json_global)
var tmp=string.replace(tmp,"@{json}",json)
//替换插入依赖js,css
var tmp=string.replace(
tmp,"@{importHtml}",
string.replace(importHtml,"@{path}",path_base+"assets\import")
var tmp_template=string.replace(
tmp_template,"@{importHtml}",
tmp_importHtml
)

//加入
html=string.replace(html,"@<head>","<head>"+'\r\n'+tmp)
html=string.replace(html,"@<head>","<head>"+'\r\n'+tmp_template)

console.log("patch:",p)

Expand All @@ -78,11 +94,10 @@ fsys.enum(path_manual,"*.htm",function(dirname,filename,fullpath,findData){
}
},);


//复制import
fsys.copy(
fsys.path.canonicalize(path+"/patch/import")
,fsys.path.canonicalize(path+"/build/assets/import")
,fsys.path.canonicalize(path+"/build/assets/")
)
console.log("copy:","!!!import!!!")

Expand Down
Binary file modified GameMakerManualTranslatorBuild.exe
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
"A simple command looks like this:&nbsp;":"一个简单的命令看起来像这样:",
"All debug messages that you show using {}{}show_debug_message{}{}&nbsp;and {}{}show_debug_message_ext{}{}&nbsp;are also shown here.":"使用{}{}show_debug_message{}{}和{}{}show_debug_message_ext{}{}显示的所有调试消息也显示在此处。",
"All subsequent words following the first word are converted into values that are passed as arguments to the function, as follows:&nbsp;":"第一个单词之后的所有后续单词都将转换为作为参数传递给函数的值,如下所示:",
"All windows of the Debug Overlay can be dragged by clicking and holding&nbsp;{}{}{}&nbsp;on the title bar or by performing the same action anywhere else on empty window space.":"通过在标题栏上单击并按住 {}{}{},或在空白窗口空间的任何其他位置执行相同的操作,可以拖动 \" 窗口覆盖 \" 的所有窗口。",
"Any text surrounded by double quotes {}\"\"{} is treated as a string":"任何用双引号{}\"\"{}括起来的文本都被视为字符串",
"Anything else not following the above rule is treated as a string":"不遵循上述规则的任何其他内容都被视为字符串",
"Clicking&nbsp;{}{}{}&nbsp;on the title bar and dragging the window allows you to \"dock\" the window to other windows in a variety of ways:&nbsp;":"单击标题栏上的 {}{}{} 并拖动窗口,您可以通过多种方式将窗口 \" 停靠 \" 到其他窗口:",
"Controls":"控制 Controls",
"Creating Debug Views":"创建调试视图",
"DebugView":"调试视图",
"Dock it as a tabbed window without splitting the other window.":"将其停靠为选项卡式窗口,而无需拆分其他窗口。",
"Dock it while splitting the other window in half.":"将其停靠,同时将另一个窗口分成两半。",
"Drag the {}Texture Index{} slider to select the texture. For every texture, the following information is shown:&nbsp;":"拖动 {} 纹理索引 {} 滑块以选择纹理。对于每个纹理,都会显示以下信息:",
"Dragging and Docking Windows":"拖动和对接窗口",
"Each menu item shows the name of the debug view with a check mark on the right if the view is set to be visible. Clicking the menu item toggles the visibility of this debug view.":"如果视图设置为可见,则每个菜单项都会显示调试视图的名称,并在右侧显示一个复选标记。单击菜单项可切换此调试视图的可见性。",
"Enable the {}Stacked{}&nbsp;option to display the time values for specific types of processing that {}GameMaker{}&nbsp;does:&nbsp;":"启用 {}堆叠 Stacked{}选项可显示{}GameMaker{}执行的特定处理类型的时间值:",
"Finally, you can {}Clear{} the output and {}Copy{} its contents to the clipboard.":"最后,您可以{}清除{}输出并{}将其内容复制{}到剪贴板。",
Expand All @@ -25,9 +30,11 @@
"Keyboard &amp; Mouse":"键盘 和 鼠标",
"Keyboard &amp; Mouse Events":"键盘 和 鼠标事件",
"References can be created to all kinds of variables. Each control supports a reference to one or more datatypes.":"可以创建对所有类型变量的引用。每个控件支持对一个或多个数据类型的引用。",
"See the {}ImGUI&nbsp;documentation on Docking{} for more information.":"如需了解更多信息,请参阅 {} 有关对接的 ImGUI 文档{}。",
"System":"系统 System",
"Texture":"纹理",
"The above lines of code will show the following window in {}The Debug Overlay{}:&nbsp;":"以上代码行将在{}调试覆盖{}中显示以下窗口:",
"The built-in windows moved into a single window":"内置窗口移动到一个单一的窗口",
"The console also&nbsp;supports autocomplete that you can access by pressing the Tab&nbsp;key, which will be shown when the cursor is on a word with more than 2 characters. Up and Down keys select the option in the dropdown box and Escape closes the autocomplete:&nbsp;":"控制台还支持自动完成功能,您可以通过按Tab键来访问该功能,当光标位于超过2个字符的单词上时,将显示该功能。向上键和向下键选择下拉框中的选项,然后Escape关闭自动完成:",
"The console stores a history&nbsp;of your last commands. Press the Up and Down arrow keys to go through the previous commands.":"控制台存储您最后命令的历史记录。按向上和向下箭头键浏览前面的命令。",
"The first argument is its name, the second is its visibility. Optional parameters can be passed to customise its position and size.":"第一个参数是它的名称,第二个参数是它的可见性。可以传递可选参数以自定义其位置和大小。",
Expand All @@ -46,9 +53,12 @@
"This menu contains two settings related to the debug&nbsp;overlay:&nbsp;":"此菜单包含两个与调试覆盖相关的设置:",
"This menu lists all the custom debug views that you\u0027ve created using&nbsp;{}{}dbg_view{}{}.":"此菜单列出了您使用{}{}dbg_view{}{}创建的所有自定义调试视图。",
"This toggles the visibility&nbsp;of all custom debug views created using&nbsp;{}{}dbg_view{}{}.":"这将切换使用{}{}dbg_view{}{}创建的所有自定义调试视图的可见性。",
"This window can also be opened with the&nbsp;{}{}audio_debug{}{}&nbsp;function.":"该窗口也可以使用 {}{}audio_debug{}{} 函数打开。",
"This window displays the Output Log, same as the one that appears in the IDE under {}The Output Window{}.":"此窗口显示输出日志,与IDE中{}\"输出窗口\"{}下显示的输出日志相同。",
"This window shows all&nbsp;{}Texture Pages{} used by your game.":"此窗口显示您的游戏使用的所有 {} 纹理页面 {}。",
"This window shows debug information related to the audio playing in your game.":"此窗口显示与游戏中播放的音频相关的调试信息。",
"This window shows various info related to&nbsp;{}GameMaker{}\u0027s memory usage.":"此窗口显示与 {}GameMaker{} 内存使用情况相关的各种信息。",
"This works with the built-in windows as well as with custom debug views that you create. The window that you drag onto another one is always added as a tabbed window. Dragging the tab moves a window back into a separate window.":"这适用于内置窗口以及您创建的自定义调试视图。您拖动到另一个窗口上的窗口始终会添加为选项卡式窗口。拖动选项卡会将窗口移回到单独的窗口中。",
"To these sections you add controls that display and/or modify the value that they\u0027re linked to via a reference created with {}{}ref_create{}{}.":"您可以向这些部分添加控件,这些控件通过使用{}{}ref_create{}{}创建的引用显示和/或修改它们链接到的值。",
"Toggling":"切换 Toggling",
"Views":"视图 Views",
Expand Down Expand Up @@ -105,6 +115,7 @@
"{}{}NOTE{}{} Texture swaps and vertex batches will never be zero and will normally show values of 2 or 3, since even with an empty room and no objects {}GameMaker{} still has to draw and batch things.":"{}{}注意{}{} 纹理交换和顶点批处理永远不会为零,默认下会显示2或3的值,因为即使有一个空房间和没有对象{}GameMaker{}仍然需要绘制和批处理东西。",
"{}{}NOTE{}{}&nbsp;A&nbsp;debug control created before a section is created will be added to a new section named {}\"Default\"{}. A debug section that\u0027s created before a debug view is created will be added to a debug view {}\"Default\"{}.":"{}{}注意{} {}在创建节之前创建的调试控件将添加到名为{}\"Default\"(默认){}的新节中。在创建调试视图之前创建的调试节将添加到调试视图{}\"Default\"{}中。",
"{}{}NOTE{}{}&nbsp;All scripts are executed within the scope of the {}global{} struct.":"{}{}注意{} {}所有脚本都在{}global{}结构的范围内执行。",
"{}{}NOTE{}{}&nbsp;The Debug Overlay is not supported on the HTML5 target platform.":"{}{} 注意{}{}HTML5 目标平台不支持网络覆盖。",
"{}{}NOTE{}{}&nbsp;The Debug menu\u0027s {}DebugView{} setting must be enabled for any custom debug views to be shown.":"{}{}注意{} {}必须启用\"调试\"菜单的{}DebugView{}设置,才能显示任何自定义调试视图。",
"{}{}NOTE{}{}&nbsp;The keyboard is considered \"used\" by the Debug Overlay when the cursor is on a textbox control and also when you drag a window (by clicking and holding the left mouse button).":"{}{} 注意{}{} 当光标位于文本框控件上以及拖动窗口 (通过单击并按住鼠标左键) 时,调试叠加层将认为 \" 已使用 \" 键盘。",
"{}{}NOTE{}{}&nbsp;While you type commands in the console input,&nbsp;{}GameMaker{}&nbsp;continues to trigger events based on the&nbsp;{}Keyboard Input{}&nbsp;that you provide, meaning your game still receives input.":"{}{}注意{}{}当您在控制台输入中键入命令时,{}GameMaker{}会继续根据您提供的{}键盘输入{}触发事件,这意味着您的游戏仍会接收输入。",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"A reference to a&nbsp;{}{}Boolean{}{} variable created using&nbsp;{}{}ref_create{}{}":"对使用{}{}ref_create{}{}创建的{0}{1}布尔{2}{3}变量的引用",
"A reference to a&nbsp;{}{}Boolean{}{} variable created using&nbsp;{}{}ref_create{}{}, or an array of references":"对使用 {}{}ref_create{}{} 创建的 {0}{1} 布尔 {2}{3} 变量的引用,或引用数组",
"The checkbox takes the reference of a&nbsp;{}{}Boolean{}{}&nbsp;variable. Clicking it toggles the variable. You can also pass an array of references, in which case a new checkbox will be created for each reference in the array.":"复选框接受 {}{} 布尔 {}{} 变量的引用。单击它可以切换变量。您也可以传递引用数组,在这种情况下,将为数组中的每个引用创建一个新复选框。",
"The checkbox takes the value of a&nbsp;{}{}Boolean{}{}&nbsp;variable. Clicking it toggles the variable.":"复选框采用{}{}布尔{}{}变量的值。单击它可切换变量。",
"The code above sets a boolean variable {}toggle{} in the Create event. It creates a reference to the variable using&nbsp;{}{}ref_create{}{}, stores it in a local variable {}_ref_to_toggle{}&nbsp;and passes that to&nbsp;{}{}dbg_checkbox{}{}. Since no calls were made to&nbsp;{}{}dbg_view{}{}&nbsp;or {}{}dbg_section{}{},&nbsp;a new view&nbsp;{}\"Default\"{} and a new section&nbsp;{}\"Default\"{} are created that the checkbox control is added to.&nbsp;The checkbox will show a text label \"The Toggle Switch\" next to it.":"上面的代码在Create事件中设置了一个布尔变量{}toggle{}。它使用{}{}ref_create{}{}创建对变量的引用,将其存储在局部变量{}_ref_to_toggle{}中,并将其传递给{}{}dbg_checkbox{}{}。由于未调用{}{}dbg_view{}{}或{}{}dbg_section{}{},因此将创建一个新视图{}\"Default\"{}和一个新节{}\"Default\"{},并将复选框控件添加到其中。复选框旁边将显示文本标签\"切换开关\"",
"The current debug section is the&nbsp;one last created using&nbsp;{}{}dbg_section{}{}.":"当前调试节是上次使用{}{}dbg_section{}{}创建的调试节。",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"A reference created using&nbsp;{}{}ref_create{}{}&nbsp;to a&nbsp;{}{}Colour{}{} variable":"使用{}{}ref_create{}{}对{}{}Colour{}{}变量创建的引用",
"A reference created using&nbsp;{}{}ref_create{}{}&nbsp;to a&nbsp;{}{}Colour{}{} variable, or an array containing references":"使用 {}{}ref_create{}{} 对 {}{}Colour{}{} 变量创建的引用,或包含引用的数组",
"In the Clean Up event, every instance&nbsp;of this object deletes its debug view and section that it created ({}my_view{} and {}my_section{} respectively).":"在清理事件中,此对象的每个实例都将删除其创建的调试视图和节(分别为{}my_view{}和{}my_section{})。",
"The code above is added to an&nbsp;{}object{}\u0027s Create event. Every {}instance{}&nbsp;of this object that executes the code creates a new debug view using&nbsp;{}{}dbg_view{}{}, stores it in an instance variable {}my_view{}&nbsp;and adds a section named \"Colours\" to it using {}{}dbg_section{}{}, stored in a variable {}my_section{}. Each&nbsp;of them then adds a colour control using&nbsp;{}{}dbg_colour{}{}&nbsp;that changes that instance\u0027s&nbsp;{}{}image_blend{}{}&nbsp;colour.":"上面的代码被添加到{}对象{}的Create事件中。执行代码的此对象的每个{}实例{}使用{}{}dbg_view{}{}创建新的调试视图,将其存储在实例变量{}my_view{}中,并使用{}{}dbg_section{}{}向其添加名为\"Colours\"的节,该节存储在变量{}my_section{}中。然后,它们中的每一个都使用{}{}dbg_colour{}{}添加一个颜色控件,以更改该实例的{}{}image_blend{}{}颜色。",
"The control takes the value of a&nbsp;{}{}Colour{}{}&nbsp;variable and shows the R, G and B component:&nbsp;":"该控件接受{}{}Colour{}{}变量的值,并显示R、G和B分量:",
"This function creates a colour control&nbsp;within the current debug section.":"此函数在当前调试部分中创建颜色控制。",
"You can pass an array as the first argument, in which case the function will create a new colour control for each reference in the array.":"你可以传递一个数组作为第一个参数,在这种情况下,函数将为数组中的每个引用创建一个新的颜色控制。",
"{}You can change the R, G and B value by double-clicking on the value and entering a new value. You can also&nbsp;click the square on the right that shows the colour to bring up a colour picker dialog to select a new colour.":"{}你可以通过双击值并输入新值来更改R、G和B值。你也可以点击右边显示颜色的方块,弹出一个颜色选择器对话框来选择新的颜色。",
"{}{}NOTE{}{}&nbsp;The value is an RGB colour value, {}without{} an alpha component.":"{}{}注意{} {}该值为RGB颜色值,{}不含{}Alpha分量。",
"{}{}NOTE{}{}&nbsp;This debug control spans two columns.":"{}{}注意{} {}此调试控制跨越两列。",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"A comma-delimited string listing the&nbsp;options and,&nbsp;optionally, the integer value to use (e.g. {}\"Zero,One:10,Two:20\"{})":"一个逗号分隔的字符串,列出了选项和要使用的整数值(可选)(例如{}\"Zero,One:10,Two:20\"{})",
"A reference to the variable, created using&nbsp;{}{}ref_create{}{}":"使用{}{}ref_create{}{}创建的变量引用",
"A reference to the variable, created&nbsp;using&nbsp;{}{}ref_create{}{}, or an array containing references":"使用 {}{}ref_create{}{} 创建的变量引用,或包含引用的数组",
"The code above first set an instance variable {}difficulty{} that stores the game\u0027s difficulty level. It creates a reference to the variable using&nbsp;{}{}ref_create{}{}&nbsp;and creates a dropdown control using&nbsp;{}{}dbg_drop_down{}{} to change the variable through that reference. The {}specifier{} lists the four difficulty levels as {}\"Easy:0,Normal:1,Hard:2,Impossible:3\"{}.":"上面的代码首先设置了一个实例变量{}difficulty{},用于存储游戏的难度级别。它使用{}{}ref_create{}{}创建对变量的引用,并使用{}{}dbg_drop_down{}{}创建下拉控件,以通过该引用更改变量。{}说明符{}列出了四个难度级别{}\"简单:0,普通:1,困难:2,不可能:3\"{}。",
"The values and names for the drop down are specified as a comma-delimited string, where integer values can&nbsp;optionally be specified after a colon symbol. For example {}\"Zero,One:10,Two:20\"{} creates a 3 entry drop down that will set the variable to the value 0, 10&nbsp;or 20, depending&nbsp;on the selected&nbsp;option.":"下拉列表的值和名称指定为逗号分隔的字符串,其中可以在冒号符号后指定整数值。例如,{}\"Zero,One:10,Two:20\"{}创建一个3条目下拉列表,将变量设置为值0、10或20,具体取决于所选选项。",
"This function creates a drop down control for an integer value within the current {}debug section{}.":"此函数为当前{}调试部分{}中的整数值创建下拉控件。",
"You can also pass an array as the first argument, and the function will create a drop down for each reference in the array.":"你也可以传递一个数组作为第一个参数,函数将为数组中的每个引用创建一个下拉列表。",
"{}{}NOTE{}{}&nbsp;This debug control spans two columns.":"{}{}注意{} {}此调试控制跨越两列。",
"{}{}OPTIONAL{}{}&nbsp;A label to show next to the dropdown":"{}{}可选{} {}下拉列表旁边显示的标签"
}
Loading

0 comments on commit 9fc3c1f

Please sign in to comment.