Skip to content

Commit

Permalink
[zh] sync /contribute/localization.md
Browse files Browse the repository at this point in the history
  • Loading branch information
windsonsea committed Jul 17, 2023
1 parent 1eabaee commit 359d7f2
Showing 1 changed file with 108 additions and 26 deletions.
134 changes: 108 additions & 26 deletions content/zh-cn/docs/contribute/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ language code is `pt-br`.
一些语言使用 ISO-3166 定义的国家代码的小写版本及其语言代码。
例如,巴西葡萄牙语代码是 `pt-br`


<!--
### Fork and clone the repo
Expand All @@ -87,8 +86,8 @@ fork](/docs/contribute/new-content/open-a-pr/#fork-the-repo) of the
-->
### 派生(fork)并且克隆仓库 {#fork-and-clone-the-repo}

首先,为 [kubernetes/website](https://github.com/kubernetes/website) 仓库
[创建你自己的副本](/zh-cn/docs/contribute/new-content/open-a-pr/#fork-the-repo)
首先,为 [kubernetes/website](https://github.com/kubernetes/website)
仓库[创建你自己的副本](/zh-cn/docs/contribute/new-content/open-a-pr/#fork-the-repo)

<!--
Then, clone your fork and `cd` into it:
Expand Down Expand Up @@ -274,7 +273,7 @@ new localization branches to coordinate translation efforts. Members of
对于每个本地化,`@kubernetes/sig-docs-**-reviews` 团队被自动分派新 PR 的审阅任务。
`@kubernetes/website-maintainers` 成员可以创建新的本地化分支来协调翻译工作。
`@kubernetes/website-milestone-maintainers` 成员可以使用 `/milestone`
[Prow 命令](https://prow.k8s.io/command-help)issues 或 PR 设定里程碑。
[Prow 命令](https://prow.k8s.io/command-help)Issue 或 PR 设定里程碑。

<!--
### Configure the workflow
Expand All @@ -289,7 +288,7 @@ For an example of adding a label, see the PR for adding the
### 配置工作流程 {#configure-the-workflow}

接下来,在 `kubernetes/test-infra` 仓库中为你的本地化添加一个 GitHub 标签。
标签可让你过滤 issues 和针对特定语言的 PR。
标签可让你过滤 Issue 和针对特定语言的 PR。

有关添加标签的示例,请参见添加[意大利语标签](https://github.com/kubernetes/test-infra/pull/11316)的 PR。

Expand All @@ -307,7 +306,7 @@ existing `[languages]` block. The German block, for example, looks like:
### 修改站点配置 {#configure-the-workflow}

Kubernetes 网站使用 Hugo 作为其 Web 框架。网站的 Hugo 配置位于
[`hugo.toml`](https://github.com/kubernetes/website/tree/main/hugo.toml)文件中。
[`hugo.toml`](https://github.com/kubernetes/website/tree/main/hugo.toml) 文件中。
为了支持新的本地化,你需要修改 `hugo.toml`

在现有的 `[languages]` 下,将新语言的配置添加到 `hugo.toml` 中。
Expand Down Expand Up @@ -381,7 +380,7 @@ link).
For example, for German the strings live in `data/i18n/de/de.toml`, and
`i18n/de.toml` is a symbolic link to `data/i18n/de/de.toml`.
-->
你还需要在 `data/i18n` 中为 [localized strings](#site-strings-in-i18n) 创建一个目录;
你还需要在 `data/i18n` 中为[本地化字符串](#site-strings-in-i18n)创建一个目录;
以现有的本地化为例。要使用这些新字符串,
你还必须创建从 `i18n/<localization>.toml`
`data/i18n/<localization>/<localization>.toml`
Expand Down Expand Up @@ -419,10 +418,10 @@ To set the roles of each user contributing to the localization, create an

要设置每个对本地化做出贡献用户的角色,请在特定于语言的子目录内创建一个 `OWNERS` 文件,其中:

- **reviewers**: 具有评审人角色的 kubernetes 团队的列表,
- **reviewers**: 具有评审人角色的 Kubernetes 团队的列表,
在本例中为在[在 GitHub 中添加你的本地化团队](#add-your-localization-team-in-github)中创建的
`sig-docs-**-reviews` 团队。
- **approvers**: 具有批准人角色的 kubernetes 团队的列表,
- **approvers**: 具有批准人角色的 Kubernetes 团队的列表,
在本例中为在[在 GitHub 中添加你的本地化团队](#add-your-localization-team-in-github)中创建的
`sig-docs-**-owners` 团队。
- **labels**: 可以自动应用于 PR 的 GitHub 标签列表,
Expand All @@ -439,11 +438,17 @@ language code `es`, looks like this:

语言代码为 `es`[西班牙语 OWNERS 文件](https://git.k8s.io/website/content/es/OWNERS)看起来像:

```yaml
<!--
# See the OWNERS docs at https://go.k8s.io/owners
# This is the localization project for Spanish.
# Teams and members are visible at https://github.com/orgs/kubernetes/teams.
-->
```yaml
# 参见 OWNERS 文档,位于 https://go.k8s.io/owners

# 这是西班牙语的本地化项目
# 各团队和成员名单位于 https://github.com/orgs/kubernetes/teams

reviewers:
- sig-docs-es-reviews
Expand All @@ -466,12 +471,12 @@ For each team, add the list of GitHub users requested in
in alphabetical order.
-->
添加了特定语言的 OWNERS 文件之后,使用新的 Kubernetes 本地化团队、
`sig-docs-**-owners``sig-docs-**-reviews` 列表更新
[根目录下的 OWNERS_ALIAES](https://git.k8s.io/website/OWNERS_ALIASES) 文件。
`sig-docs-**-owners``sig-docs-**-reviews`
列表更新[根目录下的 OWNERS_ALIAES](https://git.k8s.io/website/OWNERS_ALIASES) 文件。

对于每个团队,请按字母顺序添加
[在 GitHub 中添加你的本地化团队](#add-your-localization-team-in-github)
中所请求的 GitHub 用户列表。
对于每个团队,
请按字母顺序添加[在 GitHub 中添加你的本地化团队](#add-your-localization-team-in-github)中所请求的
GitHub 用户列表。

```diff
--- a/OWNERS_ALIASES
Expand Down Expand Up @@ -640,6 +645,83 @@ should carefully review all machine-generated translations before publishing.
-->
为了确保语法和含义的准确性,本地化团队的成员应在发布之前仔细检查所有由机器生成的翻译。

<!--
### Translating SVG images
The Kubernetes project recommends using vector (SVG) images where possible, as
these are much easier for a localization team to edit. If you find a raster
image that needs localizing, consider first redrawing the English version as
a vector image, and then localize that.
-->
### 翻译 SVG 图片 {#translating-svg-images}

Kubernetes 项目建议尽可能使用矢量(SVG)图片,因为这些图片对于本地化团队来说更容易编辑。
如果你发现一个光栅图(位图)需要本地化翻译,先将英文版本重新绘制为矢量图片,然后再进行本地化。

<!--
When translating text within SVG (Scalable Vector Graphics) images, it's
essential to follow certain guidelines to ensure accuracy and maintain
consistency across different language versions. SVG images are commonly
used in the Kubernetes documentation to illustrate concepts, workflows,
and diagrams.
-->
在翻译 SVG(可缩放矢量图)图片中的文本时,需要遵循几点指导方针,
以确保准确性并在不同语言版本之间保持一致。
Kubernetes 文档中常用 SVG 图片来说明概念、工作流和图表。

<!--
1. **Identifying translatable text**: Start by identifying the text elements
within the SVG image that need to be translated. These elements typically
include labels, captions, annotations, or any text that conveys information.
-->
1. **识别可翻译文本**:首先辨别出 SVG 图片中需要翻译的文本元素。
这些元素通常包括标签、标题、注解或任何传达信息的文本。

<!--
2. **Editing SVG files**: SVG files are XML-based, which means they can be
edited using a text editor. However, it's important to note that most of the
documentation images in Kubernetes already convert text to curves to avoid font
compatibility issues. In such cases, it is recommended to use specialized SVG
editing software, such as Inkscape, for editing, open the SVG file and locate
the text elements that require translation.
-->
2. **编辑 SVG 文件**:SVG 文件是基于 XML 的,这意味着可以使用文本编辑器进行编辑。
但请注意 Kubernetes 文档中的大部分图片已经将文本转换为曲线以避免字体兼容性问题。
在这种情况下,建议使用 Inkscape 这类专业的 SVG 编辑软件,
打开 SVG 文件并定位需要翻译的文本元素。

<!--
3. **Translating the text**: Replace the original text with the translated
version in the desired language. Ensure the translated text accurately conveys
the intended meaning and fits within the available space in the image. The Open
Sans font family should be used when working with languages that use the Latin
alphabet. You can download the Open Sans typeface from here:
[Open Sans Typeface](https://fonts.google.com/specimen/Open+Sans).
-->
3. **翻译文本**:将原始的文本替换为目标语言的译文。确保翻译的文本准确传达所需的含义,
并适配图片中可用的空间。在处理使用拉丁字母的语言时,应使用 Open Sans 字体系列。
你可以从此处下载 Open Sans 字体:
[Open Sans Typeface](https://fonts.google.com/specimen/Open+Sans)

<!--
4. **Converting text to curves**: As already mentioned, to address font
compatibility issues, it is recommended to convert the translated text to
curves or paths. Converting text to curves ensures that the final image
displays the translated text correctly, even if the user's system does not
have the exact font used in the original SVG.
-->
4. **文本转换为曲线**:如前所述,为解决字体兼容性问题,建议将翻译后的文本转换为曲线或路径。
即使用户的系统没有原始 SVG 中所使用的确切字体,将文本转换为曲线也可确保最终图片能正确显示译文。

<!--
5. **Reviewing and testing**: After making the necessary translations and
converting text to curves, save and review the updated SVG image to ensure
the text is properly displayed and aligned. Check
[Preview your changes locally](https://kubernetes.io/docs/contribute/new-content/open-a-pr/#preview-locally).
-->
5. **检查和测试**:完成必要的翻译并将文本转换为曲线后,保存并检查更新后的 SVG 图片,确保文本正确显示和对齐。
参考[在本地预览你的变更](/zh-cn/docs/contribute/new-content/open-a-pr/#preview-locally)

<!--
### Source files
Expand All @@ -651,16 +733,6 @@ To find source files for your target version:
1. Navigate to the Kubernetes website repository at https://github.com/kubernetes/website.
2. Select a branch for your target version from the following table:
Target version | Branch
-----|-----
Latest version | [`main`](https://github.com/kubernetes/website/tree/main)
Previous version | [`release-{{< skew prevMinorVersion >}}`](https://github.com/kubernetes/website/tree/release-{{< skew prevMinorVersion >}})
Next version | [`dev-{{< skew nextMinorVersion >}}`](https://github.com/kubernetes/website/tree/dev-{{< skew nextMinorVersion >}})
The `main` branch holds content for the current release `{{< latest-version >}}`.
The release team creates a `{{< release-branch >}}` branch before the next
release: v{{< skew nextMinorVersion >}}.
-->
### 源文件 {#source-files}

Expand All @@ -672,6 +744,17 @@ release: v{{< skew nextMinorVersion >}}.
1. 导航到 Kubernetes website 仓库,网址为 https://github.com/kubernetes/website。
2. 从下面的表格中选择你的目标版本分支:

<!--
Target version | Branch
-----|-----
Latest version | [`main`](https://github.com/kubernetes/website/tree/main)
Previous version | [`release-{{< skew prevMinorVersion >}}`](https://github.com/kubernetes/website/tree/release-{{< skew prevMinorVersion >}})
Next version | [`dev-{{< skew nextMinorVersion >}}`](https://github.com/kubernetes/website/tree/dev-{{< skew nextMinorVersion >}})
The `main` branch holds content for the current release `{{< latest-version >}}`.
The release team creates a `{{< release-branch >}}` branch before the next
release: v{{< skew nextMinorVersion >}}.
-->
目标版本 | 分支
-----|-----
最新版本 | [`main`](https://github.com/kubernetes/website/tree/main)
Expand Down Expand Up @@ -748,7 +831,6 @@ Per CNCF policy, the localization teams must upload their meetings to the SIG
Docs YouTube playlist. A SIG Docs Co-Chair or Tech Lead can help with the
process until SIG Docs automates it.
-->

### 特定语言的 Zoom 会议 {#language-specific-zoom-meetings}

如果本地化项目需要单独的会议时间,
Expand Down

0 comments on commit 359d7f2

Please sign in to comment.