From e755ec9d2c6fc966df01e60702b73e7f5061f33d Mon Sep 17 00:00:00 2001 From: zihang Date: Fri, 27 Dec 2024 16:12:27 +0800 Subject: [PATCH] doc(i18n): translate update parts --- next/locales/zh_CN/LC_MESSAGES/toolchain.po | 408 +++++++++++--------- 1 file changed, 231 insertions(+), 177 deletions(-) diff --git a/next/locales/zh_CN/LC_MESSAGES/toolchain.po b/next/locales/zh_CN/LC_MESSAGES/toolchain.po index 301a12b8..6a9ef8b4 100644 --- a/next/locales/zh_CN/LC_MESSAGES/toolchain.po +++ b/next/locales/zh_CN/LC_MESSAGES/toolchain.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: MoonBit Document \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-26 18:16+0800\n" +"POT-Creation-Date: 2024-12-27 16:07+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: zh_CN\n" @@ -1174,8 +1174,12 @@ msgid "Module Configuration" msgstr "模块配置" #: ../../toolchain/moon/module.md:3 -msgid "moon uses the `moon.mod.json` file to identify and describe a module." +msgid "" +"moon uses the `moon.mod.json` file to identify and describe a module. For" +" full JSON schema, please check [moon's " +"repository](https://github.com/moonbitlang/moon/blob/main/crates/moonbuild/template/mod.schema.json)." msgstr "moon 使用 `moon.mod.json` 文件来标识和描述一个模块。" +"访问 [moon 的仓库](https://github.com/moonbitlang/moon/blob/main/crates/moonbuild/template/mod.schema.json) 查看完整的 JSON 模式。" #: ../../toolchain/moon/module.md:5 ../../toolchain/moon/package.md:5 msgid "Name" @@ -1381,34 +1385,34 @@ msgid "" "}\n" msgstr "" -#: ../../toolchain/moon/module.md:122 ../../toolchain/moon/package.md:224 +#: ../../toolchain/moon/module.md:122 ../../toolchain/moon/package.md:272 msgid "Warning List" msgstr "警告列表" -#: ../../toolchain/moon/module.md:124 ../../toolchain/moon/package.md:226 +#: ../../toolchain/moon/module.md:124 ../../toolchain/moon/package.md:274 msgid "This is used to disable specific preset compiler warning numbers." msgstr "这用于禁用特定的预设编译器警告编号。" -#: ../../toolchain/moon/module.md:126 ../../toolchain/moon/package.md:228 +#: ../../toolchain/moon/module.md:126 ../../toolchain/moon/package.md:276 msgid "" "For example, in the following configuration, `-2` disables the warning " "number 2 (Unused variable)." msgstr "例如,在以下配置中,`-2` 禁用警告编号 2(未使用的变量)。" -#: ../../toolchain/moon/module.md:128 ../../toolchain/moon/package.md:230 +#: ../../toolchain/moon/module.md:128 ../../toolchain/moon/package.md:278 msgid "" "{\n" " \"warn-list\": \"-2\",\n" "}\n" msgstr "" -#: ../../toolchain/moon/module.md:134 ../../toolchain/moon/package.md:236 +#: ../../toolchain/moon/module.md:134 ../../toolchain/moon/package.md:284 msgid "" "You can use `moonc build-package -warn-help` to see the list of preset " "compiler warning numbers." msgstr "你可以使用 `moonc build-package -warn-help` 来查看预设编译器警告编号列表。" -#: ../../toolchain/moon/module.md:136 ../../toolchain/moon/package.md:238 +#: ../../toolchain/moon/module.md:136 ../../toolchain/moon/package.md:286 msgid "" "$ moonc -v \n" "v0.1.20240914+b541585d3\n" @@ -1441,15 +1445,15 @@ msgid "" " A all warnings\n" msgstr "" -#: ../../toolchain/moon/module.md:168 ../../toolchain/moon/package.md:270 +#: ../../toolchain/moon/module.md:168 ../../toolchain/moon/package.md:318 msgid "Alert List" msgstr "警示列表" -#: ../../toolchain/moon/module.md:170 ../../toolchain/moon/package.md:272 +#: ../../toolchain/moon/module.md:170 ../../toolchain/moon/package.md:320 msgid "Disable user preset alerts." msgstr "禁用用户预设警示。" -#: ../../toolchain/moon/module.md:172 ../../toolchain/moon/package.md:274 +#: ../../toolchain/moon/module.md:172 ../../toolchain/moon/package.md:322 msgid "" "{\n" " \"alert-list\": \"-alert_1-alert_2\"\n" @@ -1461,8 +1465,12 @@ msgid "Package Configuration" msgstr "包配置" #: ../../toolchain/moon/package.md:3 -msgid "moon uses the `moon.pkg.json` file to identify and describe a package." +msgid "" +"moon uses the `moon.pkg.json` file to identify and describe a package. " +"For full JSON schema, please check [moon's " +"repository](https://github.com/moonbitlang/moon/blob/main/crates/moonbuild/template/pkg.schema.json)." msgstr "moon 使用 `moon.pkg.json` 文件来标识和描述一个包。" +"访问 [moon 的仓库](https://github.com/moonbitlang/moon/blob/main/crates/moonbuild/template/pkg.schema.json) 查看完整的 JSON 模式。" #: ../../toolchain/moon/package.md:7 msgid "" @@ -1578,19 +1586,19 @@ msgstr "例如:" #: ../../toolchain/moon/package.md:49 msgid "" "{\n" -" \"targets\": {\n" -" \"only_js.mbt\": [\"js\"],\n" -" \"only_wasm.mbt\": [\"wasm\"],\n" -" \"only_wasm_gc.mbt\": [\"wasm-gc\"],\n" -" \"all_wasm.mbt\": [\"wasm\", \"wasm-gc\"],\n" -" \"not_js.mbt\": [\"not\", \"js\"],\n" -" \"only_debug.mbt\": [\"debug\"],\n" -" \"js_and_release.mbt\": [\"and\", [\"js\"], [\"release\"]],\n" -" \"js_only_test.mbt\": [\"js\"],\n" -" \"js_or_wasm.mbt\": [\"js\", \"wasm\"],\n" -" \"wasm_release_or_js_debug.mbt\": [\"or\", [\"and\", \"wasm\", " +" \"targets\": {\n" +" \"only_js.mbt\": [\"js\"],\n" +" \"only_wasm.mbt\": [\"wasm\"],\n" +" \"only_wasm_gc.mbt\": [\"wasm-gc\"],\n" +" \"all_wasm.mbt\": [\"wasm\", \"wasm-gc\"],\n" +" \"not_js.mbt\": [\"not\", \"js\"],\n" +" \"only_debug.mbt\": [\"debug\"],\n" +" \"js_and_release.mbt\": [\"and\", [\"js\"], [\"release\"]],\n" +" \"js_only_test.mbt\": [\"js\"],\n" +" \"js_or_wasm.mbt\": [\"js\", \"wasm\"],\n" +" \"wasm_release_or_js_debug.mbt\": [\"or\", [\"and\", \"wasm\", " "\"release\"], [\"and\", \"js\", \"debug\"]]\n" -" }\n" +" }\n" "}\n" msgstr "" @@ -1636,9 +1644,9 @@ msgstr "当 `link` 值为对象时,表示应链接包,您可以指定链接 msgid "Wasm Backend Link Options" msgstr "Wasm 后端链接选项" -#: ../../toolchain/moon/package.md:84 ../../toolchain/moon/package.md:152 -msgid "Configurable Options" -msgstr "可配置选项" +#: ../../toolchain/moon/package.md:84 +msgid "Common Options" +msgstr "共有选项" #: ../../toolchain/moon/package.md:86 msgid "" @@ -1668,48 +1676,31 @@ msgid "" " \"hello\",\n" " \"foo:bar\"\n" " ]\n" +" },\n" +" \"wasm-gc\": {\n" +" \"exports\": [\n" +" \"hello\",\n" +" \"foo:bar\"\n" +" ]\n" " }\n" " }\n" "}\n" msgstr "" -#: ../../toolchain/moon/package.md:103 -msgid "" -"The `heap-start-address` option is used to specify the starting address " -"of the linear memory that can be used when compiling to the Wasm backend." -msgstr "`heap-start-address` 选项用于指定编译到 Wasm 后端时可以使用的线性内存的起始地址。" - -#: ../../toolchain/moon/package.md:105 -msgid "" -"For example, the following configuration sets the starting address of the" -" linear memory to 1024." -msgstr "例如,以下配置将线性内存的起始地址设置为 1024。" - -#: ../../toolchain/moon/package.md:107 -msgid "" -"{\n" -" \"link\": {\n" -" \"wasm\": {\n" -" \"heap-start-address\": 1024\n" -" }\n" -" }\n" -"}\n" -msgstr "" - -#: ../../toolchain/moon/package.md:117 +#: ../../toolchain/moon/package.md:109 msgid "" "The `import-memory` option is used to specify the linear memory imported " "by the Wasm module." msgstr "`import-memory` 选项用于指定 Wasm 模块导入的线性内存。" -#: ../../toolchain/moon/package.md:119 +#: ../../toolchain/moon/package.md:111 msgid "" "For example, the following configuration specifies that the linear memory" " imported by the Wasm module is the `memory` variable from the `env` " "module." msgstr "例如,以下配置指定 Wasm 模块导入的线性内存是 `env` 模块的 `memory` 变量。" -#: ../../toolchain/moon/package.md:121 +#: ../../toolchain/moon/package.md:113 msgid "" "{\n" " \"link\": {\n" @@ -1718,49 +1709,138 @@ msgid "" " \"module\": \"env\",\n" " \"name\": \"memory\"\n" " }\n" +" },\n" +" \"wasm-gc\": {\n" +" \"import-memory\": {\n" +" \"module\": \"env\",\n" +" \"name\": \"memory\"\n" +" }\n" " }\n" " }\n" "}\n" msgstr "" -#: ../../toolchain/moon/package.md:134 +#: ../../toolchain/moon/package.md:132 msgid "" "The `export-memory-name` option is used to specify the name of the linear" " memory exported by the Wasm module." msgstr "`export-memory-name` 选项用于指定 Wasm 模块导出的线性内存的名称。" -#: ../../toolchain/moon/package.md:136 +#: ../../toolchain/moon/package.md:134 msgid "" "{\n" " \"link\": {\n" " \"wasm\": {\n" " \"export-memory-name\": \"memory\"\n" +" },\n" +" \"wasm-gc\": {\n" +" \"export-memory-name\": \"memory\"\n" +" }\n" +" }\n" +"}\n" +msgstr "" + +#: ../../toolchain/moon/package.md:147 +msgid "Wasm Linear Backend Link Options" +msgstr "Wasm 线性内存后端链接选项" + +#: ../../toolchain/moon/package.md:149 +msgid "" +"The `heap-start-address` option is used to specify the starting address " +"of the linear memory that can be used when compiling to the Wasm backend." +msgstr "`heap-start-address` 选项用于指定编译到 Wasm 后端时可以使用的线性内存的起始地址。" + +#: ../../toolchain/moon/package.md:151 +msgid "" +"For example, the following configuration sets the starting address of the" +" linear memory to 1024." +msgstr "例如,以下配置将线性内存的起始地址设置为 1024。" + +#: ../../toolchain/moon/package.md:153 +msgid "" +"{\n" +" \"link\": {\n" +" \"wasm\": {\n" +" \"heap-start-address\": 1024\n" " }\n" " }\n" "}\n" msgstr "" -#: ../../toolchain/moon/package.md:146 +#: ../../toolchain/moon/package.md:163 msgid "Wasm GC Backend Link Options" msgstr "Wasm GC 后端链接选项" -#: ../../toolchain/moon/package.md:148 +#: ../../toolchain/moon/package.md:165 msgid "" -"The link options for the `wasm-gc` backend are similar to those for the " -"Wasm backend, except there is no `heap-start-address` option." -msgstr "`wasm-gc` 后端的链接选项与 Wasm 后端的类似,只是没有 `heap-start-address` 选项。" +"The `use-js-string-builtin` option is used to specify whether the [JS " +"String Builtin Proposal](https://github.com/WebAssembly/js-string-" +"builtins/blob/main/proposals/js-string-builtins/Overview.md) should be " +"enabled when compiling to the Wasm GC backend. It will make the `String`" +" in MoonBit equivalent to the `String` in JavaScript host runtime." +msgstr "" +"`use-js-string-builtin` 选项用于指定在编译到 Wasm GC 后端时是否应启用 " +"[内建 JS String 提案](https://github.com/WebAssembly/js-string-builtins/blob/main/proposals/js-string-builtins/Overview.md)" +"。它将使 MoonBit 中的 `String` 等效于 JavaScript 宿主运行时中的 `String`。" -#: ../../toolchain/moon/package.md:150 +#: ../../toolchain/moon/package.md:168 +msgid "For example, the following configuration enables the JS String Builtin." +msgstr "例如,以下配置将启用内建 JS String 提案。" + +#: ../../toolchain/moon/package.md:170 +msgid "" +"{\n" +" \"link\": {\n" +" \"wasm-gc\": {\n" +" \"use-js-builtin-string\": true\n" +" }\n" +" }\n" +"}\n" +msgstr "" + +#: ../../toolchain/moon/package.md:180 +msgid "" +"The `imported-string-constants` option is used to specify the imported " +"string namespace used by the JS String Builtin Proposal, which is \"_\" " +"by default. It should meet the configuration in the JS host runtime." +msgstr "" +"`imported-string-constants` 选项用于指定内建 JS String 提案使用的导入字符串命名空间,默认为 `_`。它应符合 JS 宿主运行时中的配置。" + +#: ../../toolchain/moon/package.md:183 +msgid "" +"For example, the following configuration and JS initialization configures" +" the imported string namespace." +msgstr "例如,以下配置与 JS 初始化配置了导入字符串命名空间。" + +#: ../../toolchain/moon/package.md:185 +msgid "" +"{\n" +" \"link\": {\n" +" \"wasm-gc\": {\n" +" \"use-js-builtin-string\": true,\n" +" \"imported-string-constants\": \"_\"\n" +" }\n" +" }\n" +"}\n" +msgstr "" + +#: ../../toolchain/moon/package.md:196 +msgid "" +"const { instance } = await WebAssembly.instantiate(bytes, {}, { " +"importedStringConstants: \"strings\" });\n" +msgstr "" + +#: ../../toolchain/moon/package.md:200 msgid "JS Backend Link Options" msgstr "JS 后端链接选项" -#: ../../toolchain/moon/package.md:154 +#: ../../toolchain/moon/package.md:202 msgid "" "The `exports` option is used to specify the function names to export in " "the JavaScript module." msgstr "`exports` 选项用于指定要在 JavaScript 模块中导出的函数名称。" -#: ../../toolchain/moon/package.md:156 +#: ../../toolchain/moon/package.md:204 msgid "" "For example, in the following configuration, the `hello` function from " "the current package is exported as the `hello` function in the JavaScript" @@ -1770,7 +1850,7 @@ msgstr "" "例如,在以下配置中,当前包中的 `hello` 函数被导出为 JavaScript 模块中的 `hello` 函数。在 JavaScript " "宿主中,可以调用 `hello` 函数来调用当前包中的 `hello` 函数。" -#: ../../toolchain/moon/package.md:158 +#: ../../toolchain/moon/package.md:206 msgid "" "{\n" " \"link\": {\n" @@ -1783,35 +1863,35 @@ msgid "" "}\n" msgstr "" -#: ../../toolchain/moon/package.md:170 +#: ../../toolchain/moon/package.md:218 msgid "" "The `format` option is used to specify the output format of the " "JavaScript module." msgstr "`format` 选项用于指定 JavaScript 模块的输出格式。" -#: ../../toolchain/moon/package.md:172 +#: ../../toolchain/moon/package.md:220 msgid "The currently supported formats are:" msgstr "目前支持的格式有:" -#: ../../toolchain/moon/package.md:173 +#: ../../toolchain/moon/package.md:221 msgid "`esm`" msgstr "" -#: ../../toolchain/moon/package.md:174 +#: ../../toolchain/moon/package.md:222 msgid "`cjs`" msgstr "" -#: ../../toolchain/moon/package.md:175 +#: ../../toolchain/moon/package.md:223 msgid "`iife`" msgstr "" -#: ../../toolchain/moon/package.md:177 +#: ../../toolchain/moon/package.md:225 msgid "" "For example, the following configuration sets the output format of the " "current package to ES Module." msgstr "例如,以下配置将当前包的输出格式设置为 ES 模块。" -#: ../../toolchain/moon/package.md:179 +#: ../../toolchain/moon/package.md:227 msgid "" "{\n" " \"link\": {\n" @@ -1822,17 +1902,17 @@ msgid "" "}\n" msgstr "" -#: ../../toolchain/moon/package.md:189 +#: ../../toolchain/moon/package.md:237 msgid "Pre-build" msgstr "预构建" -#: ../../toolchain/moon/package.md:191 +#: ../../toolchain/moon/package.md:239 msgid "" "The `\"pre-build\"` field is used to specify pre-build commands, which " "will be executed before build commands such as `moon check|build|test`." msgstr "`pre-build` 字段用于指定预构建命令,这些命令将在构建命令(如 `moon check|build|test`)之前执行。" -#: ../../toolchain/moon/package.md:193 +#: ../../toolchain/moon/package.md:241 msgid "" "`\"pre-build\"` is an array, where each element is an object containing " "`input`, `output`, and `command` fields. The `input` and `output` fields " @@ -1847,7 +1927,7 @@ msgstr "" "中,可以使用任何 shell 命令,以及分别表示输入和输出文件的 `$input` 和 `$output` " "变量。如果这些字段是数组,它们将默认使用空格连接。" -#: ../../toolchain/moon/package.md:195 +#: ../../toolchain/moon/package.md:243 msgid "" "Currently, there is a built-in special command `:embed`, which converts " "files into MoonBit source code. The `--text` parameter is used to embed " @@ -1860,7 +1940,7 @@ msgstr "" "用于二进制文件。`--text` 是默认值,可以省略。`--name` 参数用于指定生成的变量名,默认为 `resource`。该命令在 " "`moon.pkg.json` 文件所在的目录中执行。" -#: ../../toolchain/moon/package.md:197 +#: ../../toolchain/moon/package.md:245 msgid "" "{\n" " \"pre-build\": [\n" @@ -1873,23 +1953,23 @@ msgid "" "}\n" msgstr "" -#: ../../toolchain/moon/package.md:209 +#: ../../toolchain/moon/package.md:257 msgid "If the content of `a.txt` in the current package directory is:" msgstr "如果当前包目录中 `a.txt` 的内容为:" -#: ../../toolchain/moon/package.md:210 +#: ../../toolchain/moon/package.md:258 msgid "" "hello,\n" "world\n" msgstr "" -#: ../../toolchain/moon/package.md:215 +#: ../../toolchain/moon/package.md:263 msgid "" "After running `moon build`, the following `a.mbt` file will be generated " "in the directory where the `moon.pkg.json` is located:" msgstr "那么在 `moon.pkg.json` 所在目录中运行 `moon build` 后,将生成以下 `a.mbt` 文件:" -#: ../../toolchain/moon/package.md:217 +#: ../../toolchain/moon/package.md:265 msgid "" "let resource : String =\n" " #|hello,\n" @@ -1954,8 +2034,7 @@ msgstr "" msgid "" "When you see the following message, it means you have successfully logged" " in:" -msgstr "" -"当你看到以下消息时,表示你已成功登录:" +msgstr "当你看到以下消息时,表示你已成功登录:" #: ../../toolchain/moon/package-manage-tour.md:21 msgid "API token saved to ~/.moon/credentials.json\n" @@ -2003,14 +2082,14 @@ msgid "" "add the dependencies you need, or manually edit the `deps` field in " "`moon.mod.json`." msgstr "" -"你可以在 mooncakes.io 上浏览所有可用的模块。使用 `moon add` 来添加你需要的依赖,或手动编辑 `moon.mod.json` 中的 `deps` " +"你可以在 mooncakes.io 上浏览所有可用的模块。使用 `moon add` 来添加你需要的依赖,或手动编辑 " +"`moon.mod.json` 中的 `deps` " #: ../../toolchain/moon/package-manage-tour.md:41 msgid "" "For example, to add the latest version of the `Yoorkin/example/list` " "module:" -msgstr "" -"例如,要添加 `Yoorkin/example/list` 模块的最新版本:" +msgstr "例如,要添加 `Yoorkin/example/list` 模块的最新版本:" #: ../../toolchain/moon/package-manage-tour.md:43 msgid "![add deps](/imgs/add-deps.png)" @@ -2022,15 +2101,13 @@ msgstr "" #: ../../toolchain/moon/package-manage-tour.md:45 msgid "Import packages from module" -msgstr "" -"从模块导入包" +msgstr "从模块导入包" #: ../../toolchain/moon/package-manage-tour.md:47 msgid "" "Modify the configuration file `moon.pkg.json` and declare the packages " "that need to be imported in the `import` field." -msgstr "" -"修改配置文件 `moon.pkg.json` 并在 `import` 字段中声明需要导入的包。" +msgstr "修改配置文件 `moon.pkg.json` 并在 `import` 字段中声明需要导入的包。" #: ../../toolchain/moon/package-manage-tour.md:49 msgid "" @@ -2039,8 +2116,8 @@ msgid "" "package. Now, you can call the functions of the third-party package in " "the `main` package using `@list`." msgstr "" -"例如,在下面的图片中,`hello/main/moon.pkg.json` 文件被修改," -"声明了在 `main` 包中导入 `Yoorkin/example/list`。现在,你可以在 `main` 包中使用 `@list` 调用第三方包的函数。" +"例如,在下面的图片中,`hello/main/moon.pkg.json` 文件被修改,声明了在 `main` 包中导入 " +"`Yoorkin/example/list`。现在,你可以在 `main` 包中使用 `@list` 调用第三方包的函数。" #: ../../toolchain/moon/package-manage-tour.md:51 msgid "![import package](/imgs/import.png)" @@ -2070,7 +2147,8 @@ msgid "" "`of_array` and `reverse` functions to implement a new function " "`reverse_array`." msgstr "" -"在 mooncakes.io 上阅读此模块的文档,我们可以使用其 `of_array` 和 `reverse` 函数来实现一个新函数 `reverse_array`。" +"在 mooncakes.io 上阅读此模块的文档,我们可以使用其 `of_array` 和 `reverse` 函数来实现一个新函数 " +"`reverse_array`。" #: ../../toolchain/moon/package-manage-tour.md:66 msgid "![reverse array](/imgs/reverse-array.png)" @@ -2097,8 +2175,7 @@ msgid "" "If you are ready to share your module, use `moon publish` to push a " "module to mooncakes.io. There are some important considerations to keep " "in mind before publishing:" -msgstr "" -"如果你准备分享你的模块,使用 `moon publish` 将模块推送到 mooncakes.io。在发布之前有一些重要的注意事项需要记住:" +msgstr "如果你准备分享你的模块,使用 `moon publish` 将模块推送到 mooncakes.io。在发布之前有一些重要的注意事项需要记住:" #: ../../toolchain/moon/package-manage-tour.md:77 msgid "Semantic versioning convention" @@ -2111,29 +2188,26 @@ msgid "" "number in the format `MAJOR.MINOR.PATCH`. With each push, the module must" " increment the:" msgstr "" -"MoonBit 的包管理遵循 [语义化版本](https://semver.org/) 约定。每个模块必须以 `MAJOR.MINOR.PATCH` 格式定义一个版本号。每次推送,模块必须递增:" +"MoonBit 的包管理遵循 [语义化版本](https://semver.org/) 约定。每个模块必须以 " +"`MAJOR.MINOR.PATCH` 格式定义一个版本号。每次推送,模块必须递增:" #: ../../toolchain/moon/package-manage-tour.md:81 msgid "MAJOR version when you make incompatible API changes" -msgstr "" -"当你进行不兼容的 API 更改时,递增 MAJOR 版本" +msgstr "当你进行不兼容的 API 更改时,递增 MAJOR 版本" #: ../../toolchain/moon/package-manage-tour.md:82 msgid "MINOR version when you add functionality in a backward compatible manner" -msgstr "" -"在向后兼容的方式下添加功能时,递增 MINOR 版本" +msgstr "在向后兼容的方式下添加功能时,递增 MINOR 版本" #: ../../toolchain/moon/package-manage-tour.md:83 msgid "PATCH version when you make backward compatible bug fixes" -msgstr "" -"在进行向后兼容的错误修复时,递增 PATCH 版本" +msgstr "在进行向后兼容的错误修复时,递增 PATCH 版本" #: ../../toolchain/moon/package-manage-tour.md:85 msgid "" "Additional labels for pre-release and build metadata are available as " "extensions to the `MAJOR.MINOR.PATCH` format." -msgstr "" -"附加的预发布和构建元数据标签可作为 `MAJOR.MINOR.PATCH` 格式的扩展。" +msgstr "附加的预发布和构建元数据标签可作为 `MAJOR.MINOR.PATCH` 格式的扩展。" #: ../../toolchain/moon/package-manage-tour.md:87 msgid "" @@ -2145,9 +2219,8 @@ msgid "" "versioning convention, aiming to make the user's dependency graph as " "close as possible to the author's development-time dependencies." msgstr "" -"moon 实现了 [最小版本选择](https://research.swtch.com/vgo-mvs)," -"根据模块的语义化版本信息自动处理和安装依赖。最小版本选择假定每个模块声明自己的依赖要求," -"并遵循语义化版本约定,旨在使用户的依赖图尽可能接近作者的开发时依赖。" +"moon 实现了 [最小版本选择](https://research.swtch.com/vgo-" +"mvs),根据模块的语义化版本信息自动处理和安装依赖。最小版本选择假定每个模块声明自己的依赖要求,并遵循语义化版本约定,旨在使用户的依赖图尽可能接近作者的开发时依赖。" #: ../../toolchain/moon/package-manage-tour.md:89 msgid "Readme & metadata" @@ -2155,13 +2228,11 @@ msgstr "自述文件 & 元数据" #: ../../toolchain/moon/package-manage-tour.md:91 msgid "Metadata in `moon.mod.json` and `README.md` will be shown in mooncakes.io." -msgstr "" -"`moon.mod.json` 和 `README.md` 中的元数据将显示在 mooncakes.io 上。" +msgstr "`moon.mod.json` 和 `README.md` 中的元数据将显示在 mooncakes.io 上。" #: ../../toolchain/moon/package-manage-tour.md:93 msgid "Metadata consist of the following sections:" -msgstr "" -"元数据包括以下部分:" +msgstr "元数据包括以下部分:" #: ../../toolchain/moon/package-manage-tour.md:95 msgid "" @@ -2197,8 +2268,7 @@ msgstr "mooncakes.io 将自动生成每个模块的文档。" msgid "" "The leading `///` comments of each toplevel will be recognized as " "documentation. You can write markdown inside." -msgstr "" -"每个顶级的 `///` 注释将被识别为文档。你可以在其中写 markdown。" +msgstr "每个顶级的 `///` 注释将被识别为文档。你可以在其中写 markdown。" #: ../../toolchain/moon/package-manage-tour.md:108 msgid "" @@ -2223,8 +2293,7 @@ msgstr "" msgid "" "You can also use `moon doc --serve` to generate and view documentation in" " local." -msgstr "" -"你也可以使用 `moon doc --serve` 来生成并在本地查看文档。" +msgstr "你也可以使用 `moon doc --serve` 来生成并在本地查看文档。" #: ../../toolchain/moon/tutorial.md:1 msgid "MoonBit's Build System Tutorial" @@ -2237,8 +2306,8 @@ msgid "" "incremental builds. Additionally, moon also supports managing and " "building third-party packages on [mooncakes.io](https://mooncakes.io/)" msgstr "" -"Moon 是 MoonBit 语言的构建系统,目前基于 [n2](https://github.com/evmar/n2) 项目。" -"Moon 支持并行和增量构建。此外,moon 还在 [mooncakes.io](https://mooncakes.io/) 上管理和构建第三方包。" +"Moon 是 MoonBit 语言的构建系统,目前基于 [n2](https://github.com/evmar/n2) 项目。Moon " +"支持并行和增量构建。此外,moon 还在 [mooncakes.io](https://mooncakes.io/) 上管理和构建第三方包。" #: ../../toolchain/moon/tutorial.md:5 msgid "Prerequisites" @@ -2248,8 +2317,7 @@ msgstr "先决条件" msgid "" "Before you begin with this tutorial, make sure you have installed the " "following:" -msgstr "" -"在开始本教程之前,请确保你已安装以下内容:" +msgstr "在开始本教程之前,请确保你已安装以下内容:" #: ../../toolchain/moon/tutorial.md:9 msgid "" @@ -2257,13 +2325,12 @@ msgid "" ". This command line tool is needed" " for creating and managing MoonBit projects." msgstr "" -"**MoonBit CLI 工具**:从 下载。" -"这个命令行工具用于创建和管理 MoonBit 项目。" +"**MoonBit CLI 工具**:从 " +"下载。这个命令行工具用于创建和管理 MoonBit 项目。" #: ../../toolchain/moon/tutorial.md:11 msgid "Use `moon help` to view the usage instructions." -msgstr "" -"使用 `moon help` 查看使用说明。" +msgstr "使用 `moon help` 查看使用说明。" #: ../../toolchain/moon/tutorial.md:13 msgid "" @@ -2278,15 +2345,14 @@ msgid "" "environment for MoonBit, including functionalities like syntax " "highlighting, code completion, and more." msgstr "" -"Visual Studio Code 中的 **MoonBit 语言** 插件:你可以从 VS Code 市场安装。" -"此插件为 MoonBit 提供了丰富的开发环境,包括语法高亮、代码补全等功能。" +"Visual Studio Code 中的 **MoonBit 语言** 插件:你可以从 VS Code 市场安装。此插件为 MoonBit " +"提供了丰富的开发环境,包括语法高亮、代码补全等功能。" #: ../../toolchain/moon/tutorial.md:20 msgid "" "Once you have these prerequisites fulfilled, let's start by creating a " "new MoonBit module." -msgstr "" -"一旦你满足了这些先决条件,我们就可以开始创建一个新的 MoonBit 模块。" +msgstr "一旦你满足了这些先决条件,我们就可以开始创建一个新的 MoonBit 模块。" #: ../../toolchain/moon/tutorial.md:22 msgid "Creating a New Module" @@ -2299,8 +2365,8 @@ msgid "" "values, you can create a new module named `username/hello` in the `my-" "project` directory." msgstr "" -"要创建一个新模块,在终端中输入 `moon new` 命令,你将看到模块创建向导。" -"通过使用所有默认值,你可以在 `my-project` 目录中创建一个名为 `username/hello` 的新模块。" +"要创建一个新模块,在终端中输入 `moon new` 命令,你将看到模块创建向导。通过使用所有默认值,你可以在 `my-project` " +"目录中创建一个名为 `username/hello` 的新模块。" #: ../../toolchain/moon/tutorial.md:26 msgid "" @@ -2319,7 +2385,8 @@ msgid "" "If you want use all default values, you can use `moon new my-project` to " "create a new module named `username/hello` in the `my-project` directory." msgstr "" -"如果你想使用所有默认值,你可以使用 `moon new my-project` 在 `my-project` 目录中创建一个名为 `username/hello` 的新模块。" +"如果你想使用所有默认值,你可以使用 `moon new my-project` 在 `my-project` 目录中创建一个名为 " +"`username/hello` 的新模块。" #: ../../toolchain/moon/tutorial.md:38 msgid "Understanding the Module Directory Structure" @@ -2329,8 +2396,7 @@ msgstr "理解模块目录结构" msgid "" "After creating the new module, your directory structure should resemble " "the following:" -msgstr "" -"创建新模块后,你的目录结构应该如下:" +msgstr "创建新模块后,你的目录结构应该如下:" #: ../../toolchain/moon/tutorial.md:42 msgid "" @@ -2350,8 +2416,7 @@ msgstr "" #: ../../toolchain/moon/tutorial.md:57 msgid "Here's a brief explanation of the directory structure:" -msgstr "" -"以下是目录结构的简要说明:" +msgstr "以下是目录结构的简要说明:" #: ../../toolchain/moon/tutorial.md:59 msgid "" @@ -2360,8 +2425,8 @@ msgid "" "`source` specifies the source directory of the module. The default value " "is `src`." msgstr "" -"`moon.mod.json` 用于标识目录为 MoonBit 模块。它包含模块的元数据,如模块名称、版本等。" -"`source` 指定模块的源目录。默认值是 `src`。" +"`moon.mod.json` 用于标识目录为 MoonBit 模块。它包含模块的元数据,如模块名称、版本等。`source` " +"指定模块的源目录。默认值是 `src`。" #: ../../toolchain/moon/tutorial.md:61 msgid "" @@ -2387,17 +2452,16 @@ msgid "" "files are for blackbox test, so private members of the `lib` package " "cannot be accessed directly." msgstr "" -"`lib` 和 `main` 目录:这些是模块中的包。每个包可以包含多个 `.mbt` 文件,这些文件是 MoonBit 语言的源代码文件。" -"但是,无论一个包有多少 `.mbt` 文件,它们都共享一个公共的 `moon.pkg.json` 文件。" -"`lib/*_test.mbt` 是 `lib` 包中的单独测试文件,这些文件用于黑盒测试,因此 `lib` 包的私有成员不能直接访问。" +"`lib` 和 `main` 目录:这些是模块中的包。每个包可以包含多个 `.mbt` 文件,这些文件是 MoonBit " +"语言的源代码文件。但是,无论一个包有多少 `.mbt` 文件,它们都共享一个公共的 `moon.pkg.json` " +"文件。`lib/*_test.mbt` 是 `lib` 包中的单独测试文件,这些文件用于黑盒测试,因此 `lib` 包的私有成员不能直接访问。" #: ../../toolchain/moon/tutorial.md:76 msgid "" "`moon.pkg.json` is package descriptor. It defines the properties of the " "package, such as whether it is the main package and the packages it " "imports." -msgstr "" -"`moon.pkg.json` 是包描述符。它定义了包的属性,例如它是否是 main 包以及它导入的包。" +msgstr "`moon.pkg.json` 是包描述符。它定义了包的属性,例如它是否是 main 包以及它导入的包。" #: ../../toolchain/moon/tutorial.md:78 msgid "`main/moon.pkg.json`:" @@ -2417,8 +2481,7 @@ msgstr "" msgid "" "Here, `\"is_main: true\"` declares that the package needs to be linked by" " the build system into a wasm file." -msgstr "" -"这里,`\"is_main: true\"` 声明该包需要被构建系统链接为一个 Wasm 文件。" +msgstr "这里,`\"is_main: true\"` 声明该包需要被构建系统链接为一个 Wasm 文件。" #: ../../toolchain/moon/tutorial.md:91 msgid "`lib/moon.pkg.json`:" @@ -2432,8 +2495,7 @@ msgstr "" msgid "" "This file is empty. Its purpose is simply to inform the build system that" " this folder is a package." -msgstr "" -"此文件为空。它的目的只是告诉构建系统这个文件夹是一个包。" +msgstr "此文件为空。它的目的只是告诉构建系统这个文件夹是一个包。" #: ../../toolchain/moon/tutorial.md:99 msgid "Working with Packages" @@ -2443,15 +2505,13 @@ msgstr "使用包" msgid "" "Our `username/hello` module contains two packages: `username/hello/lib` " "and `username/hello/main`." -msgstr "" -"我们的 `username/hello` 模块包含两个包:`username/hello/lib` 和 `username/hello/main`。" +msgstr "我们的 `username/hello` 模块包含两个包:`username/hello/lib` 和 `username/hello/main`。" #: ../../toolchain/moon/tutorial.md:103 msgid "" "The `username/hello/lib` package contains `hello.mbt` and " "`hello_test.mbt` files:" -msgstr "" -"`username/hello/lib` 包包含 `hello.mbt` 和 `hello_test.mbt` 文件:" +msgstr "`username/hello/lib` 包包含 `hello.mbt` 和 `hello_test.mbt` 文件:" #: ../../toolchain/moon/tutorial.md:105 msgid "`hello.mbt`" @@ -2492,8 +2552,7 @@ msgstr "" msgid "" "To execute the program, specify the file system's path to the " "`username/hello/main` package in the `moon run` command:" -msgstr "" -"要执行程序,在 `moon run` 命令中指定文件系统路径到 `username/hello/main` 包:" +msgstr "要执行程序,在 `moon run` 命令中指定文件系统路径到 `username/hello/main` 包:" #: ../../toolchain/moon/tutorial.md:133 msgid "" @@ -2531,8 +2590,8 @@ msgid "" "internal packages. To import the `username/hello/lib` package in " "`src/main/main.mbt`, you need to specify it in `src/main/moon.pkg.json`:" msgstr "" -"在 MoonBit 的构建系统中,模块的名称用于引用其内部包。" -"要在 `src/main/main.mbt` 中导入 `username/hello/lib` 包,你需要在 `src/main/moon.pkg.json` 中指定:" +"在 MoonBit 的构建系统中,模块的名称用于引用其内部包。要在 `src/main/main.mbt` 中导入 " +"`username/hello/lib` 包,你需要在 `src/main/moon.pkg.json` 中指定:" #: ../../toolchain/moon/tutorial.md:166 msgid "" @@ -2540,8 +2599,8 @@ msgid "" "package from the `username/hello` module, so you can use `@lib.hello()` " "in `main/main.mbt`." msgstr "" -"这里,`username/hello/lib` 指定从 `username/hello` 模块导入 `username/hello/lib` 包," -"所以你可以在 `main/main.mbt` 中使用 `@lib.hello()`。" +"这里,`username/hello/lib` 指定从 `username/hello` 模块导入 `username/hello/lib` " +"包,所以你可以在 `main/main.mbt` 中使用 `@lib.hello()`。" #: ../../toolchain/moon/tutorial.md:168 msgid "" @@ -2551,9 +2610,9 @@ msgid "" "for the package name `username/hello/lib`. In the following sections, you" " will learn how to customize the alias for a package." msgstr "" -"请注意,`src/main/moon.pkg.json` 中导入的包名是 `username/hello/lib`," -"在 `src/main/main.mbt` 中使用 `@lib` 来引用这个包。这里的导入实际上为包名 `username/hello/lib` 生成了一个默认别名。" -"在接下来的章节中,你将学习如何为包定制别名。" +"请注意,`src/main/moon.pkg.json` 中导入的包名是 `username/hello/lib`,在 " +"`src/main/main.mbt` 中使用 `@lib` 来引用这个包。这里的导入实际上为包名 `username/hello/lib` " +"生成了一个默认别名。在接下来的章节中,你将学习如何为包定制别名。" #: ../../toolchain/moon/tutorial.md:170 msgid "Creating and Using a New Package" @@ -2639,7 +2698,9 @@ msgstr "" msgid "" "In the `src/main/moon.pkg.json` file, import the `username/hello/lib/fib`" " package and customize its alias to `my_awesome_fibonacci`:" -msgstr "在 `src/main/moon.pkg.json` 文件中,导入 `username/hello/lib/fib` 包并将其别名定制为 `my_awesome_fibonacci`:" +msgstr "" +"在 `src/main/moon.pkg.json` 文件中,导入 `username/hello/lib/fib` 包并将其别名定制为 " +"`my_awesome_fibonacci`:" #: ../../toolchain/moon/tutorial.md:237 msgid "" @@ -2661,8 +2722,8 @@ msgid "" "in the `hello` module. After doing this, you can use the `fib` package in" " `main/main.mbt`. Replace the file content of `main/main.mbt` to:" msgstr "" -"这一行导入了 `fib` 包,它是 `hello` 模块中 `lib` 包的一部分。" -"在这样做之后,你可以在 `main/main.mbt` 中使用 `fib` 包。" +"这一行导入了 `fib` 包,它是 `hello` 模块中 `lib` 包的一部分。在这样做之后,你可以在 `main/main.mbt` 中使用" +" `fib` 包。" #: ../../toolchain/moon/tutorial.md:252 msgid "" @@ -2694,8 +2755,7 @@ msgstr "添加测试" msgid "" "Let's add some tests to verify our fib implementation. Add the following " "content in `src/lib/fib/a.mbt`:" -msgstr "" -"让我们添加一些测试来验证我们的 fib 实现。在 `src/lib/fib/a.mbt` 中添加以下内容:" +msgstr "让我们添加一些测试来验证我们的 fib 实现。在 `src/lib/fib/a.mbt` 中添加以下内容:" #: ../../toolchain/moon/tutorial.md:274 msgid "`src/lib/fib/a.mbt`" @@ -2717,23 +2777,18 @@ msgid "" "This code tests the first five terms of the Fibonacci sequence. `test { " "... }` defines an inline test block. The code inside an inline test block" " is executed in test mode." -msgstr "" -"这段代码测试斐波那契数列的前五项。`test { ... }` 定义了一个内联测试块。" -"内联测试块中的代码在测试模式下执行。" +msgstr "这段代码测试斐波那契数列的前五项。`test { ... }` 定义了一个内联测试块。内联测试块中的代码在测试模式下执行。" #: ../../toolchain/moon/tutorial.md:288 msgid "" "Inline test blocks are discarded in non-test compilation modes (`moon " "build` and `moon run`), so they won't cause the generated code size to " "bloat." -msgstr "" -"内联测试块在非测试编译模式(`moon build` 和 `moon run`)中被丢弃," -"因此它们不会导致生成的代码大小膨胀。" +msgstr "内联测试块在非测试编译模式(`moon build` 和 `moon run`)中被丢弃,因此它们不会导致生成的代码大小膨胀。" #: ../../toolchain/moon/tutorial.md:290 msgid "Stand-alone test files for blackbox tests" -msgstr "" -"黑盒测试的独立测试文件" +msgstr "黑盒测试的独立测试文件" #: ../../toolchain/moon/tutorial.md:292 msgid "" @@ -2742,8 +2797,8 @@ msgid "" " tests. For example, inside the `src/lib/fib` directory, create a file " "named `fib_test.mbt` and paste the following code:" msgstr "" -"除了内联测试,MoonBit 还支持独立测试文件。以 `_test.mbt` 结尾的源文件被视为黑盒测试的测试文件。" -"例如,在 `src/lib/fib` 目录中,创建一个名为 `fib_test.mbt` 的文件,并粘贴以下代码:" +"除了内联测试,MoonBit 还支持独立测试文件。以 `_test.mbt` 结尾的源文件被视为黑盒测试的测试文件。例如,在 " +"`src/lib/fib` 目录中,创建一个名为 `fib_test.mbt` 的文件,并粘贴以下代码:" #: ../../toolchain/moon/tutorial.md:294 msgid "`src/lib/fib/fib_test.mbt`" @@ -2768,9 +2823,8 @@ msgid "" "`_test.mbt`. This new package will import the current package " "automatically, allowing you to use `@lib` in the test code." msgstr "" -"注意,测试代码使用 `@fib` 来引用 `username/hello/lib/fib` 包。" -"构建系统通过使用以 `_test.mbt` 结尾的文件自动为黑盒测试创建一个新包。" -"这个新包将自动导入当前包,允许你在测试代码中使用 `@lib`。" +"注意,测试代码使用 `@fib` 来引用 `username/hello/lib/fib` 包。构建系统通过使用以 `_test.mbt` " +"结尾的文件自动为黑盒测试创建一个新包。这个新包将自动导入当前包,允许你在测试代码中使用 `@lib`。" #: ../../toolchain/moon/tutorial.md:308 msgid "" @@ -2778,8 +2832,8 @@ msgid "" "identifies, and runs all inline tests as well as files ending with " "`_test.mbt`. If everything is normal, you will see:" msgstr "" -"最后,使用 `moon test` 命令,它会扫描整个项目,识别并运行所有内联测试以及以 `_test.mbt` 结尾的文件。" -"如果一切正常,你将看到:" +"最后,使用 `moon test` 命令,它会扫描整个项目,识别并运行所有内联测试以及以 `_test.mbt` " +"结尾的文件。如果一切正常,你将看到:" #: ../../toolchain/moon/tutorial.md:310 msgid ""