docs/TRANSLATING.md
As part of our mission to democratize machine learning, we aim to make the Transformers library available in many more languages! Follow the steps below to help translate the documentation into your language.
First, fork the Transformers repo by clicking the Fork button in the top-right corner.
Clone your fork to your local machine for editing with the following command:
git clone https://github.com/YOUR-USERNAME/transformers.git
Replace YOUR-USERNAME with your GitHub username.
The documentation files are organized in the following directory:
To copy the English version to your new language directory:
Navigate to your fork of the repository:
cd ~/path/to/transformers/docs
Replace ~/path/to with your actual path.
Run the following command:
cp -r source/en source/LANG-ID
Replace LANG-ID with the appropriate ISO 639-1 or ISO 639-2 language code (see this table for reference).
Begin translating the text!
Start with the _toctree.yml file that corresponds to your documentation chapter. This file is essential for rendering the table of contents on the website.
_toctree.yml file doesn't exist for your language, create one by copying the English version and removing unrelated sections.docs/source/LANG-ID/ directory.Here’s an example structure for the _toctree.yml file:
- sections:
- local: pipeline_tutorial # Keep this name for your .md file
title: Pipelines for Inference # Translate this
...
title: Tutorials # Translate this
Once you’ve translated the _toctree.yml, move on to translating the associated MDX files.
If you'd like assistance with your translation, open an issue and tag @stevhliu. Feel free to share resources or glossaries to ensure consistent terminology.