From a7b1ad4cba106ad4e93a54f6343d2a4339d0fac9 Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Tue, 2 Sep 2025 08:52:28 +0800 Subject: [PATCH] =?UTF-8?q?docs(example-pkg):=20=E5=B0=86=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E5=92=8C=E7=94=A8=E6=88=B7=E7=95=8C=E9=9D=A2=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E4=BB=8E=E4=B8=AD=E6=96=87=E7=BF=BB=E8=AF=91=E4=B8=BA?= =?UTF-8?q?=E8=8B=B1=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将示例包的注释和用户界面文本从中文翻译为英文,以提高国际兼容性。修改包括命令补全描述、程序标题格式和用户指南文本。 --- .../example-pkg/1.0.0/completions/example.lua | 2 +- .../example-pkg/1.0.0/programs/example.lua | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/data/computercraft/lua/rom/packages/example-pkg/1.0.0/completions/example.lua b/data/computercraft/lua/rom/packages/example-pkg/1.0.0/completions/example.lua index 97024dc..e924b4a 100644 --- a/data/computercraft/lua/rom/packages/example-pkg/1.0.0/completions/example.lua +++ b/data/computercraft/lua/rom/packages/example-pkg/1.0.0/completions/example.lua @@ -3,7 +3,7 @@ local shell = require('shell') local completion = require('completion') --- 为example命令设置补全 +-- Set up completion for example command shell.setCompletionFunction('example', completion.build({ -- 这里可以添加example命令的补全逻辑 completion.choice{'--help', '-h'} diff --git a/data/computercraft/lua/rom/packages/example-pkg/1.0.0/programs/example.lua b/data/computercraft/lua/rom/packages/example-pkg/1.0.0/programs/example.lua index 8256818..0594b5d 100644 --- a/data/computercraft/lua/rom/packages/example-pkg/1.0.0/programs/example.lua +++ b/data/computercraft/lua/rom/packages/example-pkg/1.0.0/programs/example.lua @@ -1,5 +1,6 @@ --- 示例包程序 +-- Example Package Program local colors = require('colors') +local term = require('term') function drawTopBar() local w, h = term.getSize() @@ -7,7 +8,7 @@ function drawTopBar() term.setTextColor(colors.white) term.setCursorPos(1, 1) term.clearLine() - local title = "Example Package v1.0.0" + local title = "=== Example Package v1.0.0 ===" local pos = math.floor((w - #title) / 2) + 1 term.setCursorPos(pos, 1) term.write(title) @@ -17,12 +18,12 @@ function drawTopBar() end drawTopBar() -print("\n这是一个示例包,展示了LeonOS包管理器的功能。") -print("\n使用方法:") -print(" pkg install example-pkg - 安装此包") -print(" pkg remove example-pkg - 卸载此包") -print(" pkg list - 列出已安装的包") -print("\n按任意键退出...") +print("\nThis is an example package that demonstrates the features of LeonOS package manager.") +print("\nUsage:") +print(" pkg install example-pkg - Install this package") +print(" pkg remove example-pkg - Uninstall this package") +print(" pkg list - List installed packages") +print("\nPress any key to exit...") os.pullEvent("key") term.clear() term.setCursorPos(1, 1) \ No newline at end of file