Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2dfc8cd

Browse files
author
Nils Lindemann
committed
Shorten the added section
And use a friendlier heading.
1 parent 887cdb9 commit 2dfc8cd

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

docs/en/docs/contributing.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -372,23 +372,24 @@ You can continue with the previous instructions for an "Existing Language" for t
372372

373373
You can make the first pull request with those two files, `docs/ht/mkdocs.yml` and `docs/ht/index.md`. 🎉
374374

375-
#### Things to be kept as-is
375+
#### Tips and tricks for translation
376376

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 translate the code examples at `./docs_src`.
378378

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.
380380

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).
382382

383-
* Do not change things wrapped in "``" (inline code).
383+
* In lines starting with `===` or `!!!`, translate only the ` "... Text ..."` part. Leave the rest unchanged.
384384

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.
386386

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.
388388

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.
392393

393394
#### Preview the result
394395

0 commit comments

Comments
 (0)