You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/docs/contributing.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -372,23 +372,24 @@ You can continue with the previous instructions for an "Existing Language" for t
372
372
373
373
You can make the first pull request with those two files, `docs/ht/mkdocs.yml` and `docs/ht/index.md`. 🎉
374
374
375
-
#### Things to be kept as-is
375
+
#### Tips and tricks for translation
376
376
377
-
When you translate a document, there are some parts which you should not or just partially translate. Some of them, because the documentation generator requires them, in order to do specific things:
377
+
* Translate only the Markdown documents (`.md`). Do not translatethe code examples at `./docs_src`.
378
378
379
-
* Do not translate the code examples in `./docs_src`. Only translate text in the docs.
379
+
* In code blocks within the Markdown document, translate comments (`# a comment`), but leave the rest unchanged.
380
380
381
-
* In code blocks, which are inlined (instead of linking to `./docs_src`), you may translate comments (`# a comment`). Keep the rest unchanged. For example, do not change variable names.
381
+
* Do not change anything enclosed in "``" (inline code).
382
382
383
-
* Do not change things wrapped in "``" (inline code).
383
+
* In lines starting with `===` or `!!!`, translate only the ` "... Text ..."` part. Leave the rest unchanged.
384
384
385
-
* Translate the `"Text"` part in lines starting with `===` or `!!!` but keep the rest of the line as is. For example, translate `=== "Python 3.10+ non-Annotated"` to `=== "Python 3.10+ nicht annotiert"` and `!!! info "Technical Details"`, to `!!! info "Technische Details"` in German. If there is no `"Text"` part, You may add one, if necessary, for example You may change `!!! warning` to `!!! warning "Achtung"` in German. Do not change the low-caps word directly after the `!!!`, it is responsible for the coloring of the resulting box.
385
+
* You can translate info boxes like `!!! warning` with for example `!!! warning"Achtung"`. But do not change the word immediately after the `!!!`, it determines the color of the info box.
386
386
387
-
* Do not change links to local images and code files. You don't have to change anything for this to work in the translation.
387
+
* Do not change the paths in links to images, code files, Markdown documents.
388
388
389
-
* Do not change links to local markdown (`.md`) documents, including the link text, if the target document is not translated. That way, the reader can see that it is not yet translated. However, if the link text is not the verbatim title of the related section but part of the current sentence flow, translate it.
390
-
391
-
* If the target document is translated, translate both the link text and the `#hash-part` (if there is one) but do not change the path part. (To figure out the `#hash-part`, click on the "Permanent Link" icon right of the related section heading) For example, you would translate `[FastAPI Experts](../fastapi-people.md#experts)` with `[FastAPI-Experten](../fastapi-people.md#experten)` in a German translation. The path part (`../fastapi-people.md`) stays unchanged, the Link text (`FastAPI-Experten`) and the hash part (`#experten`) gets translated.
389
+
* However, when a Markdown document is translated, the `#hash-parts` in links to its headings may change. Update these links if possible.
390
+
* Search for such links in the translated document using the regex `#[^# ]`.
391
+
* Search in all documents already translated into your language, using the regex `your-translated-document\.md#`.
392
+
* When translating a document, do not "pre-translate" `#hash-parts` that link to headings in untranslated documents.
0 commit comments