Tresjs/tres

Translate docs to multiple languages

Open

#540 opened on Feb 7, 2024

 (25 comments) (1 reaction) (1 assignee)Vue (188 forks)github user discovery
docsdxfeaturehelp wantedp3-significant

Repository metrics

Stars
 (3,582 stars)
PR merge metrics
 (PR metrics pending)

Description

Description

As a developer using TresJS I would like to have documentation available in my native language

This ticket is meant to keep track of the progress of multiple PRs to translate Tres docs:

  • Enable i18n and add Spanish docs done #123 #534
  • Chinese translations @enpitsuLin #550
  • German @DennisSmuda #548
  • Polish @Dekier #546
  • French @AminGtt #555

Feel free to comment below if you would like to add your language and help us translate the docs.,

Suggested solution

Create a branch docs/translation-<language-unicode> and a PR similar to #534 with the following steps:

  1. Add a <language-unicode>.ts inside docs/.vitepress/config ex: zh.ts (copy the en.ts which is the original and then translate only what's needed.
  2. Remember to add the code prefix route to all the links on this file, ex link: /guide/ -> link: /zh/guide
  3. Add to config to docs/.vitepress/config/index.ts like this:
export default defineConfig({
  ...sharedConfig,
  locales: {
    root: { label: 'English', lang: 'en-US', link: '/', ...enConfig },
    es: { label: 'Español', lang: 'es-ES', link: '/es/', ...esConfig },
    /* zh: { label: '简体中文', lang: 'zh-CN', link: '/zh/', ...zhConfig }, */
  },
})
  1. Create a folder with the language code (ex: zh) inside docs/, this is where the translations will live, then start translating the files using the same structure as on the docs root, like this:

docs/advanced/extending.md --> docs/zh/advanced/extending.md

Alternative

No response

Additional context

No response

Validations

Contributor guide