Aller au contenu principal

Translate Wiki

Follow this guide if you want to translate the Archcraft Wiki...

Prerequisite

  • Setup the local development environment, If you want to work locally.
  • You should have the basic understanding of the syntax of Markdown and MDX. See Docusaurus Markdown Features.
  • You, at least know how to fork, clone a repository and create a pull request.

Configuration

Edit the docusaurus.config.js file and add the correct i18n locale

For Ex : If you want to translate to Russian, Add ru in locales: section -

  // Translation
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr', 'ru'],
ru: {
label: 'Russian',
direction: 'ltr',
},
},

Translate

Open the terminal (in the root directory of the website) and...

  • Create the directory for locale inside i18n.
$ mkdir -p i18n/ru
  • Run the write-translations command:
$ npm run write-translations -- --locale ru
  • Copy the original doc files inside the translation directories:
$ mkdir -p i18n/ru/docusaurus-plugin-content-docs/current
$ cp -r blog/* i18n/ru/docusaurus-plugin-content-blog
$ cp -r news/* i18n/ru/docusaurus-plugin-content-blog-news
$ cp -r docs/* i18n/ru/docusaurus-plugin-content-docs/current
  • Start your localized site in dev mode, using the locale of your choice, Your site is accessible at http://localhost:3000/ru
$ npm run start -- --locale ru
  • Translate all the files inside i18n/ru directory. And when you're done, Create a pull request with your translations.

For more info, visit Docusaurus:i18n