diff --git a/.lintstagedrc.mjs b/.lintstagedrc.mjs index 354b7bec..2610b0cd 100644 --- a/.lintstagedrc.mjs +++ b/.lintstagedrc.mjs @@ -1,5 +1,8 @@ export default { "*.ts": "eslint --fix", - "*.rs": () => ["cargo fmt", "cargo clippy --fix --allow-dirty --allow-staged"], - "*.md": () => ["pnpm doc:translate --check"] -}; \ No newline at end of file + "*.rs": () => [ + "cargo fmt", + "cargo clippy --fix --allow-dirty --allow-staged", + ], + "*.{md,mdx}": () => ["pnpm doc:translate --check"], +}; diff --git a/doc/en/nep/definition/1-package.mdx b/doc/en/nep/definition/1-package.mdx index 8696511d..bc014f24 100644 --- a/doc/en/nep/definition/1-package.mdx +++ b/doc/en/nep/definition/1-package.mdx @@ -16,9 +16,9 @@ Do not include underscores (`_`), please use spaces or hyphens (`-`) instead. * Example: `name = "VSCode"` ### description -A brief description of the package, try to extract from official channels. +A brief description of the package, try to extract the introduction from official channels. * Type: `String` -* Example: `description = "Microsoft's cross-platform open-source editor"` +* Example: `description = "An open-source cross-platform editor developed by Microsoft"` ### template Package template, in the current version, it can only be "Software". @@ -41,7 +41,7 @@ Supports wrapping author email with `<>`. * Example: `authors = ["Cno ", "Microsoft"]` ### license -Optional Open source license [SPDX identifier](https://spdx.org/licenses/) or EULA link. +Optional Open-source license [SPDX identifier](https://spdx.org/licenses/) or EULA link. * Type: `String` * Example: `license = "MIT"` @@ -53,7 +53,7 @@ Supports wrapping author email with `<>`. ### strict Optional Whether to use strict mode, the default is `true`. -When strict mode is enabled, if an error occurs in a step, the workflow will immediately stop execution and report an error; otherwise, the workflow will only warn of the error and continue to run the subsequent steps. +When strict mode is enabled, if an error occurs in a step, the workflow will immediately stop execution and report an error; otherwise, the workflow will only warn the error and continue to run the subsequent steps. :::warning Note that if you want to use the built-in variable [`ExitCode`](/nep/definition/2-context#exitcode), please set `strict` to `false`. @@ -67,9 +67,9 @@ Software package exclusive table. ### scope Software distribution domain, usually fill in the name of the upstream organization. -If the direct upstream of the software package is the distributor (organization), use the name of the distributor, such as `PortableApps`; if the direct upstream of the software package is the official website, use the name of the developer (organization), such as `Microsoft`. +If the direct upstream of the software package is the distributor/organization, use the distributor's name, such as `PortableApps`; if the direct upstream of the software package is the official website, use the developer's/organization's name, such as `Microsoft`. -If the upstream organization is a formal organization with an independent domain name, capitalize the beginning of the distribution domain, such as using `GitHub` as the distribution domain for `GitHub Desktop` published by GitHub; if the upstream organization represents a general reference to a group, use a lowercase distribution domain, such as using `github` as the distribution domain for open source projects hosted on GitHub Releases. +If the upstream organization is a formal organization with an independent domain name, capitalize the beginning of the distribution domain, such as using `GitHub` as the distribution domain for `GitHub Desktop` published by GitHub; if the upstream organization represents a general reference to a group, use a lowercase beginning for the distribution domain, such as using `github` as the distribution domain for open-source projects hosted on GitHub Releases. * Type: `String` * Example: `scope = "Microsoft"` @@ -79,7 +79,7 @@ Software upstream URL, which can be the official website's download page or the * Example: `upstream = "https://code.visualstudio.com/"` ### category -Software category, recommended to be one of the Edgeless plugin package categories. +Software category, it is recommended to be one of the Edgeless plugin package categories. * Type: `String` * Example: `category = "Integrated Development"` @@ -98,7 +98,7 @@ Software language, `Multi` indicates multiple languages. ### main_program Optional Main program path, which can be a relative or absolute path. -If using an absolute path, it must start with a [built-in variable](/nep/workflow/2-context.html#built-in-variables). +If using an absolute path, it must start with [built-in variables](/nep/workflow/2-context.html#built-in-variables). * Type: `String` * Example: ```toml diff --git a/doc/zh/nep/definition/1-package.mdx b/doc/zh/nep/definition/1-package.mdx index 595a9feb..f40fe764 100644 --- a/doc/zh/nep/definition/1-package.mdx +++ b/doc/zh/nep/definition/1-package.mdx @@ -67,7 +67,7 @@ ExSemVer 规范在 [SemVer](https://semver.org) 的基础上在`PATCH`和`PRE` ### scope 软件发行域,通常填写上游组织名称。 -若软件包的直接上游为发行商(组织)则使用发行商的名称,例如 `PortableApps`;若软件包的直接上游为官方网站则使用开发商(组织)的名称,例如 `Microsoft`。 +若软件包的直接上游为发行商/组织则使用发行商的名称,例如 `PortableApps`;若软件包的直接上游为官方网站则使用开发商/组织的名称,例如 `Microsoft`。 若上游组织为正式的、拥有独立域名的组织,则将发行域开头大写,例如对于 GitHub 发布的 `GitHub Desktop` 软件使用 `GitHub` 作为发行域;若上游组织表示对一个群体的泛指,则将发行域开头小写,例如对于将发行托管在 GitHub Releases 上的开源项目使用 `github` 作为发行域。 * 类型:`String` diff --git a/scripts/translate_wiki/prompt.md b/scripts/translate_wiki/prompt.md index c31a5f60..d777a24e 100644 --- a/scripts/translate_wiki/prompt.md +++ b/scripts/translate_wiki/prompt.md @@ -6,8 +6,9 @@ You must strictly follow the rules below. - Never change the Markdown markup structure. Don't add or remove links. Do not change any URL. - Never change the contents of code blocks even if they appear to have a bug. - Always preserve the original line breaks. Do not add or remove blank lines. Do not add lines or sections that doesn't correspond to the original text. -- Never touch the url such as `(https://example.com#id)`. +- Never touch the url such as `(https://example.com#id)`, never change the upper and lower case of url hash. - Never touch HTML-like tags such as `` ``. - Never touch abbreviations like `ept` `nep` or any other abbreviations. - Translate "外包" into "Outer-package" and "内包" into "Inner-package"; Translate "装箱单" into "manifest", "新一代" into "Next-generation". -- Translate comments that start with '#' or '//' in a code block \ No newline at end of file +- Translate comments that start with '#' or '//' in a code block +- Use "open-source" instead of "open source" \ No newline at end of file diff --git a/scripts/translate_wiki/store.json b/scripts/translate_wiki/store.json index 8cadc7cd..7934d72e 100644 --- a/scripts/translate_wiki/store.json +++ b/scripts/translate_wiki/store.json @@ -28,8 +28,8 @@ "en": "0cd61b07a5f31c7265e5ca49e6a4f1bd" }, "nep/definition/1-package.mdx": { - "zh": "790bc61a34cc1d380a13a8a7fe582675", - "en": "0659e9f28c97d8be32196deb040f3895" + "zh": "fa187c5132811b973826c783be5e772c", + "en": "122769ca9f04f91e3a1ba7edeb96d64d" }, "nep/definition/2-context.md": { "zh": "79e2ac30ca439a3b2cc2fa1554e374cd", diff --git a/scripts/translate_wiki/store.ts b/scripts/translate_wiki/store.ts index bb922ab3..6a9bd430 100644 --- a/scripts/translate_wiki/store.ts +++ b/scripts/translate_wiki/store.ts @@ -25,6 +25,7 @@ export async function readStoreMd5(fileBasePath: string): Promise { const json = await getCachedJson(); return json[fileBasePath] ?? { zh: undefined, en: undefined }; } + export async function writeStoreMd5(fileBasePath: string, node: StoreNode) { const json = await getCachedJson(); json[fileBasePath] = node;