Skip to content

Commit f6f4176

Browse files
[Docs] Add TRANSLATING.md file (#1920)
* init for korean docs * edit build yml file for multi language docs * edit one more build yml file for multi language docs * add title for get_frontmatter error * add translating.md * default language for docs is en * Update docs/TRANSLATING.md Co-authored-by: Patrick von Platen <[email protected]>
1 parent d8062ad commit f6f4176

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ doc-builder preview {package_name} {path_to_docs}
5454
For example:
5555

5656
```bash
57-
doc-builder preview diffusers docs/source/
57+
doc-builder preview diffusers docs/source/en
5858
```
5959

6060
The docs will be viewable at [http://localhost:3000](http://localhost:3000). You can also preview the docs once you have opened a PR. You will see a bot add a comment to a link where the documentation with your changes lives.

docs/TRANSLATING.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
### Translating the Diffusers documentation into your language
2+
3+
As part of our mission to democratize machine learning, we'd love to make the Diffusers library available in many more languages! Follow the steps below if you want to help translate the documentation into your language 🙏.
4+
5+
**🗞️ Open an issue**
6+
7+
To get started, navigate to the [Issues](https://github.com/huggingface/diffusers/issues) page of this repo and check if anyone else has opened an issue for your language. If not, open a new issue by selecting the "Translation template" from the "New issue" button.
8+
9+
Once an issue exists, post a comment to indicate which chapters you'd like to work on, and we'll add your name to the list.
10+
11+
12+
**🍴 Fork the repository**
13+
14+
First, you'll need to [fork the Diffusers repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo). You can do this by clicking on the **Fork** button on the top-right corner of this repo's page.
15+
16+
Once you've forked the repo, you'll want to get the files on your local machine for editing. You can do that by cloning the fork with Git as follows:
17+
18+
```bash
19+
git clone https://github.com/YOUR-USERNAME/diffusers.git
20+
```
21+
22+
**📋 Copy-paste the English version with a new language code**
23+
24+
The documentation files are in one leading directory:
25+
26+
- [`docs/source`](https://github.com/huggingface/diffusers/tree/main/docs/source): All the documentation materials are organized here by language.
27+
28+
You'll only need to copy the files in the [`docs/source/en`](https://github.com/huggingface/diffusers/tree/main/docs/source/en) directory, so first navigate to your fork of the repo and run the following:
29+
30+
```bash
31+
cd ~/path/to/diffusers/docs
32+
cp -r source/en source/LANG-ID
33+
```
34+
35+
Here, `LANG-ID` should be one of the ISO 639-1 or ISO 639-2 language codes -- see [here](https://www.loc.gov/standards/iso639-2/php/code_list.php) for a handy table.
36+
37+
**✍️ Start translating**
38+
39+
The fun part comes - translating the text!
40+
41+
The first thing we recommend is translating the part of the `_toctree.yml` file that corresponds to your doc chapter. This file is used to render the table of contents on the website.
42+
43+
> 🙋 If the `_toctree.yml` file doesn't yet exist for your language, you can create one by copy-pasting from the English version and deleting the sections unrelated to your chapter. Just make sure it exists in the `docs/source/LANG-ID/` directory!
44+
45+
The fields you should add are `local` (with the name of the file containing the translation; e.g. `autoclass_tutorial`), and `title` (with the title of the doc in your language; e.g. `Load pretrained instances with an AutoClass`) -- as a reference, here is the `_toctree.yml` for [English](https://github.com/huggingface/diffusers/blob/main/docs/source/en/_toctree.yml):
46+
47+
```yaml
48+
- sections:
49+
- local: pipeline_tutorial # Do not change this! Use the same name for your .md file
50+
title: Pipelines for inference # Translate this!
51+
...
52+
title: Tutorials # Translate this!
53+
```
54+
55+
Once you have translated the `_toctree.yml` file, you can start translating the [MDX](https://mdxjs.com/) files associated with your docs chapter.
56+
57+
> 🙋 If you'd like others to help you with the translation, you should [open an issue](https://github.com/huggingface/diffusers/issues) and tag @patrickvonplaten.

0 commit comments

Comments
 (0)