Localizing Kubernetes documentation

This page shows you how to localize the docs for a different language.

Getting started

Because contributors can’t approve their own pull requests, you need at least two contributors to begin a localization.

All localization teams must be self-sustaining with their own resources. The Kubernetes website is happy to host your work, but it’s up to you to translate it.

Find your two-letter language code

First, consult the ISO 639-1 standard to find your localization’s two-letter country code. For example, the two-letter code for Korean is ko.

Fork and clone the repo

First, create your own fork of the kubernetes/website repository.

Then, clone your fork and cd into it:

  1. git clone https://github.com/<username>/website
  2. cd website

Open a pull request

Next, open a pull request (PR) to add a localization to the kubernetes/website repository.

The PR must include all of the minimum required content before it can be approved.

For an example of adding a new localization, see the PR to enable docs in French.

Join the Kubernetes GitHub organization

Once you’ve opened a localization PR, you can become members of the Kubernetes GitHub organization. Each person on the team needs to create their own Organization Membership Request in the kubernetes/org repository.

Add your localization team in GitHub

Next, add your Kubernetes localization team to sig-docs/teams.yaml. For an example of adding a localization team, see the PR to add the Spanish localization team.

Members of @kubernetes/sig-docs-**-owners can approve PRs that change content within (and only within) your localization directory: /content/**/.

For each localization, The @kubernetes/sig-docs-**-reviews team automates review assignment for new PRs.

Members of @kubernetes/website-maintainers can create new development branches to coordinate translation efforts.

Members of @kubernetes/website-milestone-maintainers can use the /milestone Prow command to assign a milestone to issues or PRs.

Configure the workflow

Next, add a GitHub label for your localization in the kubernetes/test-infra repository. A label lets you filter issues and pull requests for your specific language.

For an example of adding a label, see the PR for adding the Italian language label.

Find community

Let Kubernetes SIG Docs know you’re interested in creating a localization! Join the SIG Docs Slack channel and the SIG Docs Localizations Slack channel. Other localization teams are happy to help you get started and answer any questions you have.

Please also consider participating in the SIG Docs Localization Subgroup meeting. The mission of the SIG Docs localization subgroup is to work across the SIG Docs localization teams to collaborate on defining and documenting the processes for creating localized contribution guides. In addition, the SIG Docs localization subgroup will look for opportunities for the creation and sharing of common tools across localization teams and also serve to identify new requirements to the SIG Docs Leadership team. If you have questions about this meeting, please inquire on the SIG Docs Localizations Slack channel.

You can also create a Slack channel for your localization in the kubernetes/community repository. For an example of adding a Slack channel, see the PR for adding a channel for Persian.

Minimum required content

Modify the site configuration

The Kubernetes website uses Hugo as its web framework. The website’s Hugo configuration resides in the config.toml file. To support a new localization, you’ll need to modify config.toml.

Add a configuration block for the new language to config.toml, under the existing [languages] block. The German block, for example, looks like:

  1. [languages.de]
  2. title = "Kubernetes"
  3. description = "Produktionsreife Container-Verwaltung"
  4. languageName = "Deutsch"
  5. contentDir = "content/de"
  6. weight = 3

When assigning a weight parameter for your block, find the language block with the highest weight and add 1 to that value.

For more information about Hugo’s multilingual support, see “Multilingual Mode“.

Add a new localization directory

Add a language-specific subdirectory to the content folder in the repository. For example, the two-letter code for German is de:

  1. mkdir content/de

Localize the community code of conduct

Open a PR against the cncf/foundation repository to add the code of conduct in your language.

Add a localized README file

To guide other localization contributors, add a new README-**.md to the top level of k/website, where ** is the two-letter language code. For example, a German README file would be README-de.md.

Provide guidance to localization contributors in the localized README-**.md file. Include the same information contained in README.md as well as:

  • A point of contact for the localization project
  • Any information specific to the localization

After you create the localized README, add a link to the file from the main English README.md, and include contact information in English. You can provide a GitHub ID, email address, Slack channel, or other method of contact. You must also provide a link to your localized Community Code of Conduct.

Setting up the OWNERS files

To set the roles of each user contributing to the localization, create an OWNERS file inside the language-specific subdirectory with:

More information about the OWNERS file can be found at go.k8s.io/owners.

The Spanish OWNERS file, with language code es, looks like:

  1. # See the OWNERS docs at https://go.k8s.io/owners
  2. # This is the localization project for Spanish.
  3. # Teams and members are visible at https://github.com/orgs/kubernetes/teams.
  4. reviewers:
  5. - sig-docs-es-reviews
  6. approvers:
  7. - sig-docs-es-owners
  8. labels:
  9. - language/es

After adding the language-specific OWNERS file, update the root OWNERS_ALIASES file with the new Kubernetes teams for the localization, sig-docs-**-owners and sig-docs-**-reviews.

For each team, add the list of GitHub users requested in Add your localization team in GitHub, in alphabetical order.

  1. --- a/OWNERS_ALIASES
  2. +++ b/OWNERS_ALIASES
  3. @@ -48,6 +48,14 @@ aliases:
  4. - stewart-yu
  5. - xiangpengzhao
  6. - zhangxiaoyu-zidif
  7. + sig-docs-es-owners: # Admins for Spanish content
  8. + - alexbrand
  9. + - raelga
  10. + sig-docs-es-reviews: # PR reviews for Spanish content
  11. + - alexbrand
  12. + - electrocucaracha
  13. + - glo-pena
  14. + - raelga
  15. sig-docs-fr-owners: # Admins for French content
  16. - perriea
  17. - remyleone

Translating content

Localizing all of the Kubernetes documentation is an enormous task. It’s okay to start small and expand over time.

At a minimum, all localizations must include:

DescriptionURLs
HomeAll heading and subheading URLs
SetupAll heading and subheading URLs
TutorialsKubernetes Basics, Hello Minikube
Site stringsAll site strings in a new localized TOML file

Translated documents must reside in their own content/**/ subdirectory, but otherwise follow the same URL path as the English source. For example, to prepare the Kubernetes Basics tutorial for translation into German, create a subfolder under the content/de/ folder and copy the English source:

  1. mkdir -p content/de/docs/tutorials
  2. cp content/en/docs/tutorials/kubernetes-basics.md content/de/docs/tutorials/kubernetes-basics.md

Translation tools can speed up the translation process. For example, some editors offers plugins to quickly translate text.

Caution: Machine-generated translation is insufficient on its own. Localization requires extensive human review to meet minimum standards of quality.

To ensure accuracy in grammar and meaning, members of your localization team should carefully review all machine-generated translations before publishing.

Source files

Localizations must be based on the English files from the most recent release, v1.20.

To find source files for the most recent release:

  1. Navigate to the Kubernetes website repository at https://github.com/kubernetes/website.
  2. Select the release-1.X branch for the most recent version.

The latest version is v1.20, so the most recent release branch is release-1.20.

Site strings in i18n

Localizations must include the contents of i18n/en.toml in a new language-specific file. Using German as an example: i18n/de.toml.

Add a new localization file to i18n/. For example, with German (de):

  1. cp i18n/en.toml i18n/de.toml

Then translate the value of each string:

  1. [docs_label_i_am]
  2. other = "ICH BIN..."

Localizing site strings lets you customize site-wide text and features: for example, the legal copyright text in the footer on each page.

Language specific style guide and glossary

Some language teams have their own language-specific style guide and glossary. For example, see the Korean Localization Guide.

Branching strategy

Because localization projects are highly collaborative efforts, we encourage teams to work in shared development branches.

To collaborate on a development branch:

  1. A team member of @kubernetes/website-maintainers opens a development branch from a source branch on https://github.com/kubernetes/website.

    Your team approvers joined the @kubernetes/website-maintainers team when you added your localization team to the kubernetes/org repository.

    We recommend the following branch naming scheme:

    dev-<source version>-<language code>.<team milestone>

    For example, an approver on a German localization team opens the development branch dev-1.12-de.1 directly against the k/website repository, based on the source branch for Kubernetes v1.12.

  2. Individual contributors open feature branches based on the development branch.

    For example, a German contributor opens a pull request with changes to kubernetes:dev-1.12-de.1 from username:local-branch-name.

  3. Approvers review and merge feature branches into the development branch.

  4. Periodically, an approver merges the development branch to its source branch by opening and approving a new pull request. Be sure to squash the commits before approving the pull request.

Repeat steps 1-4 as needed until the localization is complete. For example, subsequent German development branches would be: dev-1.12-de.2, dev-1.12-de.3, etc.

Teams must merge localized content into the same release branch from which the content was sourced. For example, a development branch sourced from release-1.20 must be based on release-1.20.

An approver must maintain a development branch by keeping it current with its source branch and resolving merge conflicts. The longer a development branch stays open, the more maintenance it typically requires. Consider periodically merging development branches and opening new ones, rather than maintaining one extremely long-running development branch.

At the beginning of every team milestone, it’s helpful to open an issue comparing upstream changes between the previous development branch and the current development branch.

While only approvers can open a new development branch and merge pull requests, anyone can open a pull request for a new development branch. No special permissions are required.

For more information about working from forks or directly from the repository, see “fork and clone the repo”.

Upstream contributions

SIG Docs welcomes upstream contributions and corrections to the English source.

Help an existing localization

You can also help add or improve content to an existing localization. Join the Slack channel for the localization, and start opening PRs to help. Please limit pull requests to a single localization since pull requests that change content in multiple localizations could be difficult to review.

What’s next

Once a localization meets requirements for workflow and minimum output, SIG docs will: