Skip to content

Latest commit

 

History

History
64 lines (42 loc) · 4.82 KB

CONTRIBUTING.md

File metadata and controls

64 lines (42 loc) · 4.82 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. Configure workflow permissions (required):

    • Go to your repository's "Settings" > "Actions" > "General" > "Workflow permissions"
    • Select "Read and write permissions"
    • Click "Save"

    This is a standard requirement for any GitHub Actions that need to create issues or make repository changes. Without these permissions, the action will fail with a 403 "Resource not accessible by integration" error when trying to create issues or manage labels.

  3. This repo uses the yuki-no GitHub Action to keep it in sync with changes from Vite's docs. It creates issues in this repo to track upstream changes that need to be translated.

    You must configure the following field in /.github/workflows/yuki-no.yml:

    • track-from: Set this to a recent commit hash from the head repository (vitejs/vite). This is the starting point for tracking changes - Yuki-no will only track commits after this hash. Using an old commit hash will significantly slow down the initial action run as it needs to process each historical commit. (After the first successful run, Yuki-no automatically skips previously processed commits.)

    By default, yuki-no uses the github-actions bot. If you want to use a custom bot:

    • 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 }})

    For more configuration options, see the yuki-no documentation.

  4. 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.
  5. 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' },
      ]
    },
  6. 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! ❤️