Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 4.17 KB

CONTRIBUTING.md

File metadata and controls

55 lines (37 loc) · 4.17 KB

Docs Translation Contributing Guide

This repo is a template for Vite.js docs translation repositories.

Creating a Translation Repo

  1. Click Use this template to scaffold a new translation repo in your personal GitHub.

  2. This repo uses the ryo-cho GitHub Action to keep it in sync with changes from Vite's docs. It creates pull requests in this repo that cherry-pick the upstream changes to be translated (example).

    Edit the following fields in /.github/workflows/ryo-cho.yml:

    • upstream-repo - the Git URL of your translation repo (the URL should end with .git)
    • upstream-repo-branch - the target branch in your translation repo

    By default, ryo-cho is configured to use the github-actions bot, which works out of the box. However, you can use your own bot by configuring the following:

    • username - the GitHub username of a machine user (e.g., ci-bot)
    • email - the email associated with the GitHub username above
    • access-token - a personal access token of the machine user (stored in a repository secret, enabling access-token: ${{ secrets.MY_SECRET_TOKEN }})
  3. Translate all user-visible strings (unless specified otherwise) in the following files to the target language:

    💡 Tips:

    • Ping the #docs channel in Discord or GitHub Discussions for others who can help with translations.
    • Submit pull requests in your repo for this work so that collaborators can proofread the translations.
  4. Create a pull request in Vite's main repo to update the locale links in docs/.vitepress/config.ts, which would add the new language to the dropdown on the Vite homepage. Specifically, append to localeLinks.items[] an object with these keys:

    • text - the language name in its native spelling (e.g., Español)
    • link - the URL to the target site, composed of the language's ISO 639-1 code as a subdomain of https://vitejs.dev (e.g., https://es.vitejs.dev)

    Example for French:

    localeLinks: {
      items: [
        { text: 'Française', link: 'https://fr.vitejs.dev' },
      ]
    },
  5. In the pull request's description, include the URL to your translation repo. Be prepared to transfer the repo to the vitejs organization upon request by the Vite team. The transfer automatically adds you as a collaborator on the repo. The repo will be renamed to docs-LANGUAGE_CODE (e.g., docs-fr) after the transfer.

    Thank you for your contribution! ❤️