mirror of https://github.com/tiangolo/fastapi.git
📝 Add discussion template for new language translation requests (#13535)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
parent
89b4d1f076
commit
3d60b5e23e
|
|
@ -0,0 +1,45 @@
|
||||||
|
labels: [lang-all]
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Thanks for your interest in helping translate the FastAPI docs! 🌍
|
||||||
|
|
||||||
|
Please follow these instructions carefully to propose a new language translation. 🙏
|
||||||
|
|
||||||
|
This structured process helps ensure translations can be properly maintained long-term.
|
||||||
|
- type: checkboxes
|
||||||
|
id: checks
|
||||||
|
attributes:
|
||||||
|
label: Initial Checks
|
||||||
|
description: Please confirm and check all the following options.
|
||||||
|
options:
|
||||||
|
- label: I checked that this language is not already being translated in FastAPI docs.
|
||||||
|
required: true
|
||||||
|
- label: I searched existing discussions to ensure no one else proposed this language.
|
||||||
|
required: true
|
||||||
|
- label: I am a native speaker of the language I want to help translate.
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
id: language
|
||||||
|
attributes:
|
||||||
|
label: Target Language
|
||||||
|
description: What language do you want to translate the FastAPI docs into?
|
||||||
|
placeholder: e.g. Latin
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: additional_info
|
||||||
|
attributes:
|
||||||
|
label: Additional Information
|
||||||
|
description: Any other relevant information about your translation proposal
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Translations are automatized with AI and then reviewed by native speakers. 🤖 🙋
|
||||||
|
|
||||||
|
This allows us to keep them consistent and up-to-date.
|
||||||
|
|
||||||
|
If there are several native speakers commenting on this discussion and
|
||||||
|
committing to help review new translations, the FastAPI team will review it
|
||||||
|
and potentially make it an official translation. 😎
|
||||||
|
|
@ -315,30 +315,47 @@ Now you can translate it all and see how it looks as you save the file.
|
||||||
|
|
||||||
Some of these files are updated very frequently and a translation would always be behind, or they include the main content from English source files, etc.
|
Some of these files are updated very frequently and a translation would always be behind, or they include the main content from English source files, etc.
|
||||||
|
|
||||||
|
#### Request a New Language
|
||||||
|
|
||||||
|
Let's say that you want to request translations for a language that is not yet translated, not even some pages. For example, Latin.
|
||||||
|
|
||||||
|
If there is no discussion for that language, you can start by requesting the new language. For that, you can follow these steps:
|
||||||
|
|
||||||
|
* Create a new discussion following the template.
|
||||||
|
* Get a few native speakers to comment on the discussion and commit to help review translations for that language.
|
||||||
|
|
||||||
|
Once there are several people in the discussion, the FastAPI team can evaluate it and can make it an official translation.
|
||||||
|
|
||||||
|
Then the docs will be automatically translated using AI, and the team of native speakers can review the translation, and help tweak the AI prompts.
|
||||||
|
|
||||||
|
Once there's a new translation, for example if docs are updated or there's a new section, there will be a comment in the same discussion with the link to the new translation to review.
|
||||||
|
|
||||||
#### New Language
|
#### New Language
|
||||||
|
|
||||||
Let's say that you want to add translations for a language that is not yet translated, not even some pages.
|
/// note
|
||||||
|
|
||||||
Let's say you want to add translations for Creole, and it's not yet there in the docs.
|
These steps will be performed by the FastAPI team.
|
||||||
|
|
||||||
Checking the link from above, the code for "Creole" is `ht`.
|
///
|
||||||
|
|
||||||
The next step is to run the script to generate a new translation directory:
|
Checking the link from above (List of ISO 639-1 codes), you can see that the 2-letter code for Latin is `la`.
|
||||||
|
|
||||||
|
Now you can create a new directory for the new language, running the following script:
|
||||||
|
|
||||||
<div class="termy">
|
<div class="termy">
|
||||||
|
|
||||||
```console
|
```console
|
||||||
// Use the command new-lang, pass the language code as a CLI argument
|
// Use the command new-lang, pass the language code as a CLI argument
|
||||||
$ python ./scripts/docs.py new-lang ht
|
$ python ./scripts/docs.py new-lang la
|
||||||
|
|
||||||
Successfully initialized: docs/ht
|
Successfully initialized: docs/la
|
||||||
```
|
```
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
Now you can check in your code editor the newly created directory `docs/ht/`.
|
Now you can check in your code editor the newly created directory `docs/la/`.
|
||||||
|
|
||||||
That command created a file `docs/ht/mkdocs.yml` with a simple config that inherits everything from the `en` version:
|
That command created a file `docs/la/mkdocs.yml` with a simple config that inherits everything from the `en` version:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
INHERIT: ../en/mkdocs.yml
|
INHERIT: ../en/mkdocs.yml
|
||||||
|
|
@ -350,11 +367,11 @@ You could also simply create that file with those contents manually.
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
||||||
That command also created a dummy file `docs/ht/index.md` for the main page, you can start by translating that one.
|
That command also created a dummy file `docs/la/index.md` for the main page, you can start by translating that one.
|
||||||
|
|
||||||
You can continue with the previous instructions for an "Existing Language" for that process.
|
You can continue with the previous instructions for an "Existing Language" for that process.
|
||||||
|
|
||||||
You can make the first pull request with those two files, `docs/ht/mkdocs.yml` and `docs/ht/index.md`. 🎉
|
You can make the first pull request with those two files, `docs/la/mkdocs.yml` and `docs/la/index.md`. 🎉
|
||||||
|
|
||||||
#### Preview the result
|
#### Preview the result
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue