Skip to content

Commit a10c8de

Browse files
doc: sync translation
1 parent 6a82ec4 commit a10c8de

File tree

2 files changed

+59
-61
lines changed

2 files changed

+59
-61
lines changed

next/locales/zh_CN/LC_MESSAGES/language.po

+30-18
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: MoonBit Document \n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-03-11 17:00+0800\n"
11+
"POT-Creation-Date: 2025-03-19 12:07+0800\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language: zh_CN\n"
@@ -1990,7 +1990,7 @@ msgstr ""
19901990
#: ../../language/error_codes/E3017.md:9 ../../language/error_codes/E3018.md:5
19911991
#: ../../language/error_codes/E3019.md:10 ../../language/error_codes/E3020.md:6
19921992
#: ../../language/error_codes/E3800.md:10 ../../language/error_codes/E4000.md:5
1993-
#: ../../language/error_codes/E4005.md:5 ../../language/error_codes/E4007.md:8
1993+
#: ../../language/error_codes/E4005.md:5 ../../language/error_codes/E4007.md:6
19941994
#: ../../language/error_codes/E4050.md:9 ../../language/error_codes/E4051.md:15
19951995
#: ../../language/error_codes/E4052.md:7 ../../language/error_codes/E4053.md:18
19961996
#: ../../language/error_codes/E4055.md:5 ../../language/error_codes/E4056.md:5
@@ -2122,7 +2122,7 @@ msgstr ""
21222122
#: ../../language/error_codes/E4004.md:14
21232123
#: ../../language/error_codes/E4005.md:14
21242124
#: ../../language/error_codes/E4006.md:21
2125-
#: ../../language/error_codes/E4007.md:21
2125+
#: ../../language/error_codes/E4007.md:19
21262126
#: ../../language/error_codes/E4008.md:14
21272127
#: ../../language/error_codes/E4009.md:21
21282128
#: ../../language/error_codes/E4010.md:19
@@ -2971,10 +2971,23 @@ msgid ""
29712971
msgstr ""
29722972

29732973
#: ../../language/error_codes/E1011.md:29
2974+
msgid "Or, you can use `is` syntax to use this pattern matching as a condition:"
2975+
msgstr ""
2976+
2977+
#: ../../language/error_codes/E1011.md:31
2978+
msgid ""
2979+
"fn main {\n"
2980+
" if Some(1) is Some(x) {\n"
2981+
" println(x)\n"
2982+
" }\n"
2983+
"}\n"
2984+
msgstr ""
2985+
2986+
#: ../../language/error_codes/E1011.md:39
29742987
msgid "Or, you can add a wildcard pattern to catch all remaining cases:"
29752988
msgstr "或者,你可以添加一个通配符模式来捕获所有剩余的情况:"
29762989

2977-
#: ../../language/error_codes/E1011.md:31
2990+
#: ../../language/error_codes/E1011.md:41
29782991
msgid ""
29792992
"fn main {\n"
29802993
" match Some(1) {\n"
@@ -5775,43 +5788,42 @@ msgstr ""
57755788

57765789
#: ../../language/error_codes/E4007.md:3
57775790
msgid ""
5778-
"When constructing an enum, the arguments passed to the constructor cannot"
5779-
" be unit `()`. MoonBit does not allow constructors to take unit as an "
5780-
"argument because it would be redundant - a constructor without arguments "
5781-
"already represents a singleton value."
5791+
"Enum variants without payloads are considered as singleton values. "
5792+
"MoonBit does not allow such constructors to be called as functions."
57825793
msgstr ""
57835794

5784-
#: ../../language/error_codes/E4007.md:10
5795+
#: ../../language/error_codes/E4007.md:8
57855796
msgid ""
57865797
"enum Status {\n"
57875798
" Done\n"
57885799
" Pending\n"
57895800
"}\n"
57905801
"\n"
57915802
"fn main {\n"
5792-
" let status = Done() // Error: constructor can't take unit as argument\n"
5803+
" let status = Done() // Error: constructor without payload cannot be "
5804+
"called with ()\n"
57935805
"}\n"
57945806
msgstr ""
57955807

5796-
#: ../../language/error_codes/E4007.md:23
5797-
msgid "Remove the unit argument from the constructor since it adds no value:"
5808+
#: ../../language/error_codes/E4007.md:21
5809+
msgid "Remove the function calling syntax from the constructor:"
57985810
msgstr ""
57995811

5800-
#: ../../language/error_codes/E4007.md:25
5812+
#: ../../language/error_codes/E4007.md:23
58015813
msgid ""
58025814
"// ...\n"
58035815
"fn main {\n"
58045816
" let status = Done\n"
58055817
"}\n"
58065818
msgstr ""
58075819

5808-
#: ../../language/error_codes/E4007.md:32
5820+
#: ../../language/error_codes/E4007.md:30
58095821
msgid ""
5810-
"If you really need the constructor to take a unit arguments, explicitly "
5811-
"use `Unit` as its argument"
5822+
"If you really need the constructor to construct values, explicitly use "
5823+
"`Unit` as its argument"
58125824
msgstr ""
58135825

5814-
#: ../../language/error_codes/E4007.md:35
5826+
#: ../../language/error_codes/E4007.md:33
58155827
msgid ""
58165828
"enum Status {\n"
58175829
" Done(Unit)\n"
@@ -6812,6 +6824,7 @@ msgid ""
68126824
" struct S { x : Int; y : Int }\n"
68136825
" struct T { x : Int; y : Int }\n"
68146826
" let c : S = { x: 2, y: 1 }\n"
6827+
" let c2 = S::{ x : 2, y : 1 }\n"
68156828
"}\n"
68166829
msgstr ""
68176830

@@ -18412,4 +18425,3 @@ msgid ""
1841218425
msgstr ""
1841318426
"黑盒测试文件(`_test.mbt`)导入当前包和包配置(`moon.pkg.json`)中的 `import` 和 `test-import` "
1841418427
"部分定义的包。"
18415-

next/locales/zh_CN/LC_MESSAGES/toolchain.po

+29-43
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: MoonBit Document \n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-03-11 16:26+0800\n"
11+
"POT-Creation-Date: 2025-03-19 12:07+0800\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language: zh_CN\n"
@@ -912,10 +912,9 @@ msgid ""
912912
"particular configuration may also determine where these scripts need to "
913913
"be placed."
914914
msgstr ""
915-
"讨论:为 Bash、Elvish、Fish、Zsh 或 PowerShell 启用命令补全功能。"
916-
"该脚本的输出在标准输出(stdout)上,用户可以将输出重定向到自己选择的文件。"
917-
"文件的存放位置将取决于所使用的 shell 以及操作系统。具体的配置也可能决定这些脚本应放置在何处。"
918-
915+
"讨论:为 Bash、Elvish、Fish、Zsh 或 PowerShell "
916+
"启用命令补全功能。该脚本的输出在标准输出(stdout)上,用户可以将输出重定向到自己选择的文件。文件的存放位置将取决于所使用的 shell "
917+
"以及操作系统。具体的配置也可能决定这些脚本应放置在何处。"
919918

920919
#: ../../toolchain/moon/commands.md:471
921920
msgid ""
@@ -925,16 +924,15 @@ msgid ""
925924
"rc file to always load newest completions on startup. Although it's "
926925
"considered not as efficient as having the completions script installed."
927926
msgstr ""
928-
"补全脚本不会自动更新,因此你可能需要定期运行此命令以获取最新的补全内容。"
929-
"或者,你可以将`eval "$(moon shell-completion --shell <SHELL>)"`添加到你所用 shell 的配置文件(rc file)中,"
930-
"这样每次启动 shell 时都会加载最新的补全内容。不过,这种方式被认为不如安装补全脚本高效。 "
927+
"补全脚本不会自动更新,因此你可能需要定期运行此命令以获取最新的补全内容。或者,你可以将`eval \"$(moon shell-"
928+
"completion --shell <SHELL>)\"`添加到你所用 shell 的配置文件(rc file)中,这样每次启动 shell "
929+
"时都会加载最新的补全内容。不过,这种方式被认为不如安装补全脚本高效。 "
931930

932931
#: ../../toolchain/moon/commands.md:478
933932
msgid ""
934933
"Here are some common set ups for the three supported shells under Unix "
935934
"and similar operating systems (such as GNU/Linux)."
936-
msgstr ""
937-
"以下是在 Unix 及类似操作系统(如 GNU/Linux)下,针对三种受支持的 shell 的一些常见设置。"
935+
msgstr "以下是在 Unix 及类似操作系统(如 GNU/Linux)下,针对三种受支持的 shell 的一些常见设置。"
938936

939937
#: ../../toolchain/moon/commands.md:481
940938
msgid "Bash:"
@@ -946,9 +944,8 @@ msgid ""
946944
"system-wide commands, but can be stored in `~/.local/share/bash-"
947945
"completion/completions` for user-specific commands. Run the command:"
948946
msgstr ""
949-
"对于系统范围的命令,补全文件通常存放在 `/etc/bash_completion.d/`;"
950-
"而针对用户特定的命令,它们可存放在 `~/.local/share/bash - completion/completions`。"
951-
"运行以下命令:"
947+
"对于系统范围的命令,补全文件通常存放在 `/etc/bash_completion.d/`;而针对用户特定的命令,它们可存放在 "
948+
"`~/.local/share/bash - completion/completions`。运行以下命令:"
952949

953950
#: ../../toolchain/moon/commands.md:488
954951
msgid ""
@@ -961,8 +958,7 @@ msgstr ""
961958
msgid ""
962959
"This installs the completion script. You may have to log out and log back"
963960
" in to your shell session for the changes to take effect."
964-
msgstr ""
965-
"这会安装补全脚本。你可能需要注销并重新登录 shell 会话,以使更改生效。"
961+
msgstr "这会安装补全脚本。你可能需要注销并重新登录 shell 会话,以使更改生效。"
966962

967963
#: ../../toolchain/moon/commands.md:494
968964
msgid "Bash (macOS/Homebrew):"
@@ -973,8 +969,8 @@ msgid ""
973969
"Homebrew stores bash completion files within the Homebrew directory. With"
974970
" the `bash-completion` brew formula installed, run the command:"
975971
msgstr ""
976-
"Homebrew 会将 bash 补全文件存储在 Homebrew 目录内。"
977-
"在安装了 `bash-completion` 的 Homebrew 软件包后,运行以下命令:"
972+
"Homebrew 会将 bash 补全文件存储在 Homebrew 目录内。在安装了 `bash-completion` 的 Homebrew "
973+
"软件包后,运行以下命令:"
978974

979975
#: ../../toolchain/moon/commands.md:499
980976
msgid ""
@@ -991,8 +987,7 @@ msgstr ""
991987
msgid ""
992988
"Fish completion files are commonly stored in "
993989
"`$HOME/.config/fish/completions`. Run the command:"
994-
msgstr ""
995-
"Fish 补全文件通常存储在 `$HOME/.config/fish/completions` 目录下。运行以下命令: "
990+
msgstr "Fish 补全文件通常存储在 `$HOME/.config/fish/completions` 目录下。运行以下命令: "
996991

997992
#: ../../toolchain/moon/commands.md:507
998993
msgid ""
@@ -1023,9 +1018,7 @@ msgid ""
10231018
"will install the completions script. Note that use `>>` (append) instead"
10241019
" of `>` (overwrite) to prevent overwriting the existing completions for "
10251020
"other commands. Then prepend your rc.elv with:"
1026-
msgstr ""
1027-
"将安装补全脚本。请注意使用`>>`(追加)而不是 `>` (覆盖),"
1028-
"以防止覆盖其他命令的现有补全。然后在你的 rc.elv 文件前面添加:"
1021+
msgstr "将安装补全脚本。请注意使用`>>`(追加)而不是 `>` (覆盖),以防止覆盖其他命令的现有补全。然后在你的 rc.elv 文件前面添加:"
10291022

10301023
#: ../../toolchain/moon/commands.md:525
10311024
msgid "`use completers`\n"
@@ -1035,7 +1028,6 @@ msgstr ""
10351028
msgid "to load the `completers` module and enable completions."
10361029
msgstr "以加载 `completers` 模块并启用补全功能。"
10371030

1038-
10391031
#: ../../toolchain/moon/commands.md:529
10401032
msgid "Zsh:"
10411033
msgstr ""
@@ -1047,17 +1039,15 @@ msgid ""
10471039
"generated script to one of those directories, or add your own to this "
10481040
"list."
10491041
msgstr ""
1050-
"ZSH补全文件通常存放在 `$fpath` 变量所列出的任意目录中。要使用这些补全功能,"
1051-
"你要么将生成的脚本添加到这些目录之一,要么将你自己的目录添加到这个列表中。"
1042+
"ZSH补全文件通常存放在 `$fpath` "
1043+
"变量所列出的任意目录中。要使用这些补全功能,你要么将生成的脚本添加到这些目录之一,要么将你自己的目录添加到这个列表中。"
10521044

10531045
#: ../../toolchain/moon/commands.md:536
10541046
msgid ""
10551047
"Adding a custom directory is often the safest bet if you are unsure of "
10561048
"which directory to use. First create the directory; for this example "
10571049
"we'll create a hidden directory inside our `$HOME` directory:"
1058-
msgstr ""
1059-
"如果你不确定该使用哪个目录,添加一个自定义目录通常是最稳妥的做法。"
1060-
"首先创建这个目录;在这个示例中,我们将在 `$HOME` 目录下创建一个隐藏目录:"
1050+
msgstr "如果你不确定该使用哪个目录,添加一个自定义目录通常是最稳妥的做法。首先创建这个目录;在这个示例中,我们将在 `$HOME` 目录下创建一个隐藏目录:"
10611051

10621052
#: ../../toolchain/moon/commands.md:541
10631053
msgid "$ mkdir ~/.zfunc\n"
@@ -1075,7 +1065,6 @@ msgstr ""
10751065
msgid "Now you can install the completions script using the following command:"
10761066
msgstr "现在你可以使用以下命令来安装补全脚本"
10771067

1078-
10791068
#: ../../toolchain/moon/commands.md:551
10801069
msgid "$ moon shell-completion --shell zsh > ~/.zfunc/_moon\n"
10811070
msgstr ""
@@ -1103,9 +1092,8 @@ msgid ""
11031092
"to add the proper directives, such as `source`ing inside your login "
11041093
"script. Consult your shells documentation for how to add such directives."
11051094
msgstr ""
1106-
"另外,你可以将这些文件保存到你选择的位置,比如你家目录($HOME)下的自定义目录。"
1107-
"这样做的话,你需要添加合适的指令,例如在登录脚本中使用 `source`命令引入这些文件。"
1108-
"请查阅你所使用 shell 的文档,了解如何添加此类指令。"
1095+
"另外,你可以将这些文件保存到你选择的位置,比如你家目录($HOME)下的自定义目录。这样做的话,你需要添加合适的指令,例如在登录脚本中使用 "
1096+
"`source`命令引入这些文件。请查阅你所使用 shell 的文档,了解如何添加此类指令。"
11091097

11101098
#: ../../toolchain/moon/commands.md:567
11111099
msgid "PowerShell:"
@@ -1116,8 +1104,8 @@ msgid ""
11161104
"The powershell completion scripts require PowerShell v5.0+ (which comes "
11171105
"with Windows 10, but can be downloaded separately for windows 7 or 8.1)."
11181106
msgstr ""
1119-
"PowerShell 补全脚本需要 PowerShell 5.0 及更高版本(Windows 10 系统自带该版本,"
1120-
"而 Windows 7 或 8.1 系统可单独下载)。 "
1107+
"PowerShell 补全脚本需要 PowerShell 5.0 及更高版本(Windows 10 系统自带该版本,而 Windows 7 或 "
1108+
"8.1 系统可单独下载)。 "
11211109

11221110
#: ../../toolchain/moon/commands.md:573
11231111
msgid "First, check if a profile has already been set"
@@ -1141,17 +1129,16 @@ msgid ""
11411129
"command it will be "
11421130
"`${env:USERPROFILE}\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1`"
11431131
msgstr ""
1144-
"现在打开由 `$profile` 指定的文件(如果你使用了 `New-Item` 命令,该文件将是"
1145-
" `${env:USERPROFILE}\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1`)。 "
1132+
"现在打开由 `$profile` 指定的文件(如果你使用了 `New-Item` 命令,该文件将是 "
1133+
"`${env:USERPROFILE}\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1`)。"
1134+
" "
11461135

11471136
#: ../../toolchain/moon/commands.md:585
11481137
msgid ""
11491138
"Next, we either save the completions file into our profile, or into a "
11501139
"separate file and source it inside our profile. To save the completions "
11511140
"into our profile simply use"
1152-
msgstr ""
1153-
"接下来,我们可以将补全文件保存到我们的配置文件中,或者保存到一个单独的文件里,
1154-
然后在配置文件中引入它。若要将补全内容保存到配置文件中,只需使用:"
1141+
msgstr "接下来,我们可以将补全文件保存到我们的配置文件中,或者保存到一个单独的文件里"
11551142

11561143
#: ../../toolchain/moon/commands.md:589
11571144
msgid ""
@@ -1737,7 +1724,7 @@ msgstr "你可以使用 `moonc build-package -warn-help` 来查看预设编译
17371724
#: ../../toolchain/moon/module.md:136 ../../toolchain/moon/package.md:305
17381725
msgid ""
17391726
"$ moonc -v \n"
1740-
"v0.1.20250310+a7a1e9804\n"
1727+
"v0.1.20250318+35770a65e\n"
17411728
"\n"
17421729
"$ moonc build-package -warn-help\n"
17431730
"Available warnings: \n"
@@ -1748,7 +1735,7 @@ msgid ""
17481735
" 5 Unused type variable.\n"
17491736
" 6 Unused constructor.\n"
17501737
" 7 Unused field or constructor argument.\n"
1751-
" 8 Redunant modifier.\n"
1738+
" 8 Redundant modifier.\n"
17521739
" 9 Unused function declaration.\n"
17531740
" 10 Struct never constructed.\n"
17541741
" 11 Partial pattern matching.\n"
@@ -1782,7 +1769,7 @@ msgid ""
17821769
" 42 Invalid attribute.\n"
17831770
" 43 Unused attribute.\n"
17841771
" 44 Invalid inline-wasm.\n"
1785-
" 45 Type implments trait with regular methods.\n"
1772+
" 45 Type implements trait with regular methods.\n"
17861773
" A all warnings\n"
17871774
msgstr ""
17881775

@@ -2767,7 +2754,6 @@ msgid ""
27672754
msgstr ""
27682755

27692756
#: ../../toolchain/moon/tutorial.md:36
2770-
#, fuzzy
27712757
msgid ""
27722758
"If you want to use all default values, you can use `moon new my-project` "
27732759
"to create a new module named `username/hello` in the `my-project` "

0 commit comments

Comments
 (0)