docs(example-pkg): 将注释和用户界面文本从中文翻译为英文

将示例包的注释和用户界面文本从中文翻译为英文,以提高国际兼容性。修改包括命令补全描述、程序标题格式和用户指南文本。
This commit is contained in:
2025-09-02 08:52:28 +08:00
parent 73c87ec3b6
commit a7b1ad4cba
2 changed files with 10 additions and 9 deletions

View File

@@ -3,7 +3,7 @@
local shell = require('shell') local shell = require('shell')
local completion = require('completion') local completion = require('completion')
-- 为example命令设置补全 -- Set up completion for example command
shell.setCompletionFunction('example', completion.build({ shell.setCompletionFunction('example', completion.build({
-- 这里可以添加example命令的补全逻辑 -- 这里可以添加example命令的补全逻辑
completion.choice{'--help', '-h'} completion.choice{'--help', '-h'}

View File

@@ -1,5 +1,6 @@
-- 示例包程序 -- Example Package Program
local colors = require('colors') local colors = require('colors')
local term = require('term')
function drawTopBar() function drawTopBar()
local w, h = term.getSize() local w, h = term.getSize()
@@ -7,7 +8,7 @@ function drawTopBar()
term.setTextColor(colors.white) term.setTextColor(colors.white)
term.setCursorPos(1, 1) term.setCursorPos(1, 1)
term.clearLine() term.clearLine()
local title = "Example Package v1.0.0" local title = "=== Example Package v1.0.0 ==="
local pos = math.floor((w - #title) / 2) + 1 local pos = math.floor((w - #title) / 2) + 1
term.setCursorPos(pos, 1) term.setCursorPos(pos, 1)
term.write(title) term.write(title)
@@ -17,12 +18,12 @@ function drawTopBar()
end end
drawTopBar() drawTopBar()
print("\n这是一个示例包展示了LeonOS包管理器的功能。") print("\nThis is an example package that demonstrates the features of LeonOS package manager.")
print("\n使用方法:") print("\nUsage:")
print(" pkg install example-pkg - 安装此包") print(" pkg install example-pkg - Install this package")
print(" pkg remove example-pkg - 卸载此包") print(" pkg remove example-pkg - Uninstall this package")
print(" pkg list - 列出已安装的包") print(" pkg list - List installed packages")
print("\n按任意键退出...") print("\nPress any key to exit...")
os.pullEvent("key") os.pullEvent("key")
term.clear() term.clear()
term.setCursorPos(1, 1) term.setCursorPos(1, 1)