Compare commits

...

2 Commits

Author SHA1 Message Date
github-actions[bot]
53d2453d1a 📝 Update release notes
[skip ci]
2025-12-29 18:54:43 +00:00
Sebastián Ramírez
d9b7b65b81 🌐 Update translation prompts (#14619) 2025-12-29 18:54:20 +00:00
13 changed files with 838 additions and 962 deletions

View File

@@ -4,213 +4,197 @@ Translate to German (Deutsch).
Language code: de.
### Definitions
"hyphen"
The character «-»
Unicode U+002D (HYPHEN-MINUS)
Alternative names: hyphen, dash, minus sign
"dash"
The character «–»
Unicode U+2013 (EN DASH)
German name: Halbgeviertstrich
### Grammar to use when talking to the reader
Use the formal grammar (use «Sie» instead of «Du»).
Use the formal grammar (use `Sie` instead of `Du`).
### Quotes
1) Convert neutral double quotes («"») and English double typographic quotes («“» and «”») to German double typographic quotes («„» and «“»). Convert neutral single quotes («'») and English single typographic quotes («‘» and «’») to German single typographic quotes («‚» and «‘»). Do NOT convert «`"» to «„», do NOT convert «"`» to «“».
1) Convert neutral double quotes (`"`) to German double typographic quotes (`„` and `“`). Convert neutral single quotes (`'`) to German single typographic quotes (`` and ``).
Do NOT convert quotes in code snippets and code blocks to their German typographic equivalents.
Examples:
Source (English):
Source (English):
«««
"Hello world"
“Hello Universe”
"He said: 'Hello'"
“my name is Nils
`"__main__"`
`"items"`
»»»
```
"Hello world"
“Hello Universe”
"He said: 'Hello'"
“my name is Nils
`"__main__"`
`"items"`
```
Result (German):
«««
„Hallo Welt“
„Hallo Universum“
„Er sagte: Hallo
„Mein Name ist Nils
`"__main__"`
`"items"`
»»»
Result (German):
```
„Hallo Welt“
„Hallo Universum“
„Er sagte: Hallo
„Mein Name ist Nils
`"__main__"`
`"items"`
```
### Ellipsis
1) Make sure there is a space between an ellipsis and a word following or preceding the ellipsis.
- Make sure there is a space between an ellipsis and a word following or preceding the ellipsis.
Examples:
Source (English):
Source (English):
«««
...as we intended.
...this would work:
...etc.
others...
More to come...
»»»
```
...as we intended.
...this would work:
...etc.
others...
More to come...
```
Result (German):
Result (German):
«««
... wie wir es beabsichtigt hatten.
... das würde funktionieren:
... usw.
Andere ...
Später mehr ...
»»»
2) This does not apply in URLs, code blocks, and code snippets. Do not remove or add spaces there.
```
... wie wir es beabsichtigt hatten.
... das würde funktionieren:
... usw.
Andere ...
Später mehr ...
```
- This does not apply in URLs, code blocks, and code snippets. Do not remove or add spaces there.
### Headings
1) Translate headings using the infinite form.
- Translate headings using the infinite form.
Examples:
Source (English):
Source (English):
«««
## Create a Project { #create-a-project }
»»»
```
## Create a Project { #create-a-project }
```
Translate with (German):
Result (German):
«««
## Ein Projekt erstellen { #create-a-project }
»»»
```
## Ein Projekt erstellen { #create-a-project }
```
Do NOT translate with (German):
Do NOT translate with (German):
«««
## Erstellen Sie ein Projekt { #create-a-project }
»»»
```
## Erstellen Sie ein Projekt { #create-a-project }
```
Source (English):
Source (English):
«««
# Install Packages { #install-packages }
»»»
```
# Install Packages { #install-packages }
```
Translate with (German):
Translate with (German):
«««
# Pakete installieren { #install-packages }
»»»
```
# Pakete installieren { #install-packages }
```
Do NOT translate with (German):
Do NOT translate with (German):
«««
# Installieren Sie Pakete { #install-packages }
»»»
```
# Installieren Sie Pakete { #install-packages }
```
Source (English):
Source (English):
«««
### Run Your Program { #run-your-program }
»»»
```
### Run Your Program { #run-your-program }
```
Translate with (German):
Translate with (German):
«««
### Ihr Programm ausführen { #run-your-program }
»»»
```
### Ihr Programm ausführen { #run-your-program }
```
Do NOT translate with (German):
Do NOT translate with (German):
«««
### Führen Sie Ihr Programm aus { #run-your-program }
»»»
```
### Führen Sie Ihr Programm aus { #run-your-program }
```
2) Make sure that the translated part of the heading does not end with a period.
- Make sure that the translated part of the heading does not end with a period.
Example:
Source (English):
Source (English):
«««
## Another module with `APIRouter` { #another-module-with-apirouter }
»»»
```
## Another module with `APIRouter` { #another-module-with-apirouter }
```
Translate with (German):
Translate with (German):
«««
## Ein weiteres Modul mit `APIRouter` { #another-module-with-apirouter }
»»»
```
## Ein weiteres Modul mit `APIRouter` { #another-module-with-apirouter }
```
Do NOT translate with (German) notice the added period:
Do NOT translate with (German) notice the added period:
«««
## Ein weiteres Modul mit `APIRouter`. { #another-module-with-apirouter }
»»»
```
## Ein weiteres Modul mit `APIRouter`. { #another-module-with-apirouter }
```
3) Replace occurrences of literal « - » (a space followed by a hyphen followed by a space) with « » (a space followed by a dash followed by a space) in the translated part of the heading.
- Replace occurrences of literal ` - ` (a space followed by a hyphen followed by a space) with ` ` (a space followed by a dash followed by a space) in the translated part of the heading.
Example:
Source (English):
Source (English):
«««
# FastAPI in Containers - Docker { #fastapi-in-containers-docker }
»»»
```
# FastAPI in Containers - Docker { #fastapi-in-containers-docker }
```
Translate with (German) notice the dash:
Translate with (German) notice the dash:
«««
# FastAPI in Containern Docker { #fastapi-in-containers-docker }
»»»
```
# FastAPI in Containern Docker { #fastapi-in-containers-docker }
```
Do NOT translate with (German) notice the hyphen:
Do NOT translate with (German) notice the hyphen:
«««
# FastAPI in Containern - Docker { #fastapi-in-containers-docker }
»»»
```
# FastAPI in Containern - Docker { #fastapi-in-containers-docker }
```
3.1) Do not apply rule 3 when there is no space before or no space after the hyphen.
- Do not apply rule 3 when there is no space before or no space after the hyphen.
Example:
Source (English):
Source (English):
«««
## Type hints and annotations { #type-hints-and-annotations }
»»»
```
## Type hints and annotations { #type-hints-and-annotations }
```
Translate with (German) notice the hyphen:
Translate with (German) - notice the hyphen:
«««
## Typhinweise und -annotationen { #type-hints-and-annotations }
»»»
```
## Typhinweise und -annotationen { #type-hints-and-annotations }
```
Do NOT translate with (German) notice the dash:
Do NOT translate with (German) - notice the dash:
«««
## Typhinweise und annotationen { #type-hints-and-annotations }
»»»
```
## Typhinweise und annotationen { #type-hints-and-annotations }
```
3.2) Do not apply rule 3 to the untranslated part of the heading inside curly brackets, which you shall not translate.
- Do not modify the hyphens in the content in headers inside of curly braces, which you shall not translate.
### German instructions, when to use and when not to use hyphens in words (written in first person, which is you)
### German instructions, when to use and when not to use hyphens in words (written in first person, which is you).
In der Regel versuche ich so weit wie möglich Worte zusammenzuschreiben, also ohne Bindestrich, es sei denn, es ist Konkretesding-Klassevondingen, etwa «Pydantic-Modell» (aber: «Datenbankmodell»), «Python-Modul» (aber: «Standardmodul»). Ich setze auch einen Bindestrich, wenn er die gleichen Buchstaben verbindet, etwa «Enum-Member», «Cloud-Dienst», «Template-Engine». Oder wenn das Wort sonst einfach zu lang wird, etwa, «Performance-Optimierung». Oder um etwas visuell besser zu dokumentieren, etwa «Pfadoperation-Dekorator», «Pfadoperation-Funktion».
@@ -219,123 +203,122 @@ In der Regel versuche ich so weit wie möglich Worte zusammenzuschreiben, also o
Ich versuche nicht, alles einzudeutschen. Das bezieht sich besonders auf Begriffe aus dem Bereich der Programmierung. Ich wandele zwar korrekt in Großschreibung um und setze Bindestriche, wo notwendig, aber ansonsten lasse ich solch ein Wort unverändert. Beispielsweise wird aus dem englischen Wort «string» in der deutschen Übersetzung «String», aber nicht «Zeichenkette». Oder aus dem englischen Wort «request body» wird in der deutschen Übersetzung «Requestbody», aber nicht «Anfragekörper». Oder aus dem englischen «response» wird im Deutschen «Response», aber nicht «Antwort».
### List of English terms and their preferred German translations
Below is a list of English terms and their preferred German translations, separated by a colon («:»). Use these translations, do not use your own. If an existing translation does not use these terms, update it to use them. In the below list, a term or a translation may be followed by an explanation in brackets, which explains when to translate the term this way. If a translation is preceded by «NOT», then that means: do NOT use this translation for this term. English nouns, starting with the word «the», have the German genus «der», «die», «das» prepended to their German translation, to help you to grammatically decline them in the translation. They are given in singular case, unless they have «(plural)» attached, which means they are given in plural case. Verbs are given in the full infinitive starting with the word «to».
Below is a list of English terms and their preferred German translations, separated by a colon (:). Use these translations, do not use your own. If an existing translation does not use these terms, update it to use them. In the below list, a term or a translation may be followed by an explanation in brackets, which explains when to translate the term this way. If a translation is preceded by `NOT`, then that means: do NOT use this translation for this term. English nouns, starting with the word `the`, have the German genus `der`, `die`, `das` prepended to their German translation, to help you to grammatically decline them in the translation. They are given in singular case, unless they have `(plural)` attached, which means they are given in plural case. Verbs are given in the full infinitive starting with the word `to`.
* «/// check»: «/// check | Testen»
* «/// danger»: «/// danger | Gefahr»
* «/// info»: «/// info | Info»
* «/// note | Technical Details»: «/// note | Technische Details»
* «/// note»: «/// note | Hinweis»
* «/// tip»: «/// tip | Tipp»
* «/// warning»: «/// warning | Achtung»
* «you»: «Sie»
* «your»: «Ihr»
* «e.g»: «z. B.»
* «etc.»: «usw.»
* «ref»: «Ref.»
* «the Tutorial - User guide»: «das Tutorial Benutzerhandbuch»
* «the Advanced User Guide»: «das Handbuch für fortgeschrittene Benutzer»
* «the SQLModel docs»: «die SQLModel-Dokumentation»
* «the docs»: «die Dokumentation» (use singular case)
* «the env var»: «die Umgebungsvariable»
* «the `PATH` environment variable»: «die `PATH`-Umgebungsvariable»
* «the `PATH`»: «der `PATH`»
* «the `requirements.txt`»: «die `requirements.txt`»
* «the API Router»: «der API-Router»
* «the Authorization-Header»: «der Autorisierungsheader»
* «the `Authorization`-Header»: «der `Authorization`-Header»
* «the background task»: «der Hintergrundtask»
* «the button»: «der Button»
* «the cloud provider»: «der Cloudanbieter»
* «the CLI»: «Das CLI»
* «the coverage»: «Die Testabdeckung»
* «the command line interface»: «Das Kommandozeileninterface»
* «the default value»: «der Defaultwert»
* «the default value»: NOT «der Standardwert»
* «the default declaration»: «die Default-Deklaration»
* «the deployment»: «das Deployment»
* «the dict»: «das Dict»
* «the dictionary»: «das Dictionary»
* «the enumeration»: «die Enumeration»
* «the enum»: «das Enum»
* «the engine»: «die Engine»
* «the error response»: «die Error-Response»
* «the event»: «das Event»
* «the exception»: «die Exception»
* «the exception handler»: «der Exceptionhandler»
* «the form model»: «das Formularmodell»
* «the form body»: «der Formularbody»
* «the header»: «der Header»
* «the headers» (plural): «die Header»
* «in headers» (plural): «in Headern»
* «the forwarded header»: «der Forwarded-Header»
* «the lifespan event»: «das Lifespan-Event»
* «the lock»: «der Lock»
* «the locking»: «das Locking»
* «the mobile application»: «die Mobile-Anwendung»
* «the model object»: «das Modellobjekt»
* «the mounting»: «das Mounten»
* «mounted»: «gemountet»
* «the origin»: «das Origin»
* «the override»: «Die Überschreibung»
* «the parameter»: «der Parameter»
* «the parameters» (plural): «die Parameter»
* «the function parameter»: «der Funktionsparameter»
* «the default parameter»: «der Defaultparameter»
* «the body parameter»: «der Body-Parameter»
* «the request body parameter»: «der Requestbody-Parameter»
* «the path parameter»: «der Pfad-Parameter»
* «the query parameter»: «der Query-Parameter»
* «the cookie parameter»: «der Cookie-Parameter»
* «the header parameter»: «der Header-Parameter»
* «the form parameter»: «der Formular-Parameter»
* «the payload»: «die Payload»
* «the performance»: NOT «die Performance»
* «the query»: «die Query»
* «the recap»: «die Zusammenfassung»
* «the request» (what the client sends to the server): «der Request»
* «the request body»: «der Requestbody»
* «the request bodies» (plural): «die Requestbodys»
* «the response» (what the server sends back to the client): «die Response»
* «the return type»: «der Rückgabetyp»
* «the return value»: «der Rückgabewert»
* «the startup» (the event of the app): «der Startup»
* «the shutdown» (the event of the app): «der Shutdown»
* «the startup event»: «das Startup-Event»
* «the shutdown event»: «das Shutdown-Event»
* «the startup» (of the server): «das Hochfahren»
* «the startup» (the company): «das Startup»
* «the SDK»: «das SDK»
* «the tag»: «der Tag»
* «the type annotation»: «die Typannotation»
* «the type hint»: «der Typhinweis»
* «the wildcard»: «die Wildcard»
* «the worker class»: «die Workerklasse»
* «the worker class»: NOT «die Arbeiterklasse»
* «the worker process»: «der Workerprozess»
* «the worker process»: NOT «der Arbeiterprozess»
* «to commit»: «committen»
* «to deploy» (in the cloud): «deployen»
* «to modify»: «ändern»
* «to serve» (an application): «bereitstellen»
* «to serve» (a response): «ausliefern»
* «to serve»: NOT «bedienen»
* «to upgrade»: «aktualisieren»
* «to wrap»: «wrappen»
* «to wrap»: NOT «hüllen»
* «`foo` as a `type`»: «`foo` vom Typ `type`»
* «`foo` as a `type`»: «`foo`, ein `type`»
* «FastAPI's X»: «FastAPIs X»
* «Starlette's Y»: «Starlettes Y»
* «X is case-sensitive»: «Groß-/Klein­schrei­bung ist relevant in X»
* «X is case-insensitive»: «Groß-/Klein­schrei­bung ist nicht relevant in X»
* «standard Python»: «Standard-Python»
* «deprecated»: «deprecatet»
* /// check: /// check | Testen
* /// danger: /// danger | Gefahr
* /// info: /// info | Info
* /// note | Technical Details: /// note | Technische Details
* /// note: /// note | Hinweis
* /// tip: /// tip | Tipp
* /// warning: /// warning | Achtung
* you: Sie
* your: Ihr
* e.g: z. B.
* etc.: usw.
* ref: Ref.
* the Tutorial - User guide: das Tutorial Benutzerhandbuch
* the Advanced User Guide: das Handbuch für fortgeschrittene Benutzer
* the SQLModel docs: die SQLModel-Dokumentation
* the docs: die Dokumentation (use singular case)
* the env var: die Umgebungsvariable
* the `PATH` environment variable: die `PATH`-Umgebungsvariable
* the `PATH`: der `PATH`
* the `requirements.txt`: die `requirements.txt`
* the API Router: der API-Router
* the Authorization-Header: der Autorisierungsheader
* the `Authorization`-Header: der `Authorization`-Header
* the background task: der Hintergrundtask
* the button: der Button
* the cloud provider: der Cloudanbieter
* the CLI: Das CLI
* the coverage: Die Testabdeckung
* the command line interface: Das Kommandozeileninterface
* the default value: der Defaultwert
* the default value: NOT der Standardwert
* the default declaration: die Default-Deklaration
* the deployment: das Deployment
* the dict: das Dict
* the dictionary: das Dictionary
* the enumeration: die Enumeration
* the enum: das Enum
* the engine: die Engine
* the error response: die Error-Response
* the event: das Event
* the exception: die Exception
* the exception handler: der Exceptionhandler
* the form model: das Formularmodell
* the form body: der Formularbody
* the header: der Header
* the headers (plural): die Header
* in headers (plural): in Headern
* the forwarded header: der Forwarded-Header
* the lifespan event: das Lifespan-Event
* the lock: der Lock
* the locking: das Locking
* the mobile application: die Mobile-Anwendung
* the model object: das Modellobjekt
* the mounting: das Mounten
* mounted: gemountet
* the origin: das Origin
* the override: Die Überschreibung
* the parameter: der Parameter
* the parameters (plural): die Parameter
* the function parameter: der Funktionsparameter
* the default parameter: der Defaultparameter
* the body parameter: der Body-Parameter
* the request body parameter: der Requestbody-Parameter
* the path parameter: der Pfad-Parameter
* the query parameter: der Query-Parameter
* the cookie parameter: der Cookie-Parameter
* the header parameter: der Header-Parameter
* the form parameter: der Formular-Parameter
* the payload: die Payload
* the performance: NOT die Performance
* the query: die Query
* the recap: die Zusammenfassung
* the request (what the client sends to the server): der Request
* the request body: der Requestbody
* the request bodies (plural): die Requestbodys
* the response (what the server sends back to the client): die Response
* the return type: der Rückgabetyp
* the return value: der Rückgabewert
* the startup (the event of the app): der Startup
* the shutdown (the event of the app): der Shutdown
* the startup event: das Startup-Event
* the shutdown event: das Shutdown-Event
* the startup (of the server): das Hochfahren
* the startup (the company): das Startup
* the SDK: das SDK
* the tag: der Tag
* the type annotation: die Typannotation
* the type hint: der Typhinweis
* the wildcard: die Wildcard
* the worker class: die Workerklasse
* the worker class: NOT die Arbeiterklasse
* the worker process: der Workerprozess
* the worker process: NOT der Arbeiterprozess
* to commit: committen
* to deploy (in the cloud): deployen
* to modify: ändern
* to serve (an application): bereitstellen
* to serve (a response): ausliefern
* to serve: NOT bedienen
* to upgrade: aktualisieren
* to wrap: wrappen
* to wrap: NOT hüllen
* `foo` as a `type`: `foo` vom Typ `type`
* `foo` as a `type`: `foo`, ein `type`
* FastAPI's X: FastAPIs X
* Starlette's Y: Starlettes Y
* X is case-sensitive: Groß-/Klein­schrei­bung ist relevant in X
* X is case-insensitive: Groß-/Klein­schrei­bung ist nicht relevant in X
* standard Python: Standard-Python
* deprecated: deprecatet
### Other rules
Preserve indentation. Keep emoticons. Encode in utf-8. Use Linux line breaks (LF).
Preserve indentation. Keep emojis. Encode in utf-8. Use Linux line breaks (LF).

View File

@@ -6,7 +6,7 @@ Tests added here will be seen by all designers of language specific prompts.
Use as follows:
* Have a language specific prompt `docs/{language code}/llm-prompt.md`.
* Have a language specific prompt - `docs/{language code}/llm-prompt.md`.
* Do a fresh translation of this document into your desired target language (see e.g. the `translate-page` command of the `translate.py`). This will create the translation under `docs/{language code}/docs/_llm-test.md`.
* Check if things are okay in the translation.
* If necessary, improve your language specific prompt, the general prompt, or the English document.

View File

@@ -15,6 +15,7 @@ hide:
### Internal
* 🌐 Update translation prompts. PR [#14619](https://github.com/fastapi/fastapi/pull/14619) by [@tiangolo](https://github.com/tiangolo).
* 🔨 Update LLM translation script to guide reviewers to change the prompt. PR [#14614](https://github.com/fastapi/fastapi/pull/14614) by [@tiangolo](https://github.com/tiangolo).
* 👷 Do not run translations on cron while finishing updating existing languages. PR [#14613](https://github.com/fastapi/fastapi/pull/14613) by [@tiangolo](https://github.com/tiangolo).
* 🔥 Remove test variants for Pydantic v1 in test_request_params. PR [#14612](https://github.com/fastapi/fastapi/pull/14612) by [@tiangolo](https://github.com/tiangolo).

View File

@@ -6,23 +6,23 @@ Language code: ja.
### Grammar and tone
1) Use polite, instructional Japanese (です/ます調).
2) Keep the tone concise and technical (match existing Japanese FastAPI docs).
- Use polite, instructional Japanese (です/ます調).
- Keep the tone concise and technical (match existing Japanese FastAPI docs).
### Headings
1) Follow the existing Japanese style: short, descriptive headings (often noun phrases), e.g. 「チェック」.
2) Do not add a trailing period at the end of headings.
- Follow the existing Japanese style: short, descriptive headings (often noun phrases), e.g. 「チェック」.
- Do not add a trailing period at the end of headings.
### Quotes
1) Prefer Japanese corner brackets 「」 in normal prose when quoting a term.
2) Do not change quotes inside inline code, code blocks, URLs, or file paths.
- Prefer Japanese corner brackets 「」 in normal prose when quoting a term.
- Do not change quotes inside inline code, code blocks, URLs, or file paths.
### Ellipsis
1) Keep ellipsis style consistent with existing Japanese docs (commonly `...`).
2) Never change `...` in code, URLs, or CLI examples.
- Keep ellipsis style consistent with existing Japanese docs (commonly `...`).
- Never change `...` in code, URLs, or CLI examples.
### Preferred translations / glossary

View File

@@ -6,23 +6,23 @@ Language code: ko.
### Grammar and tone
1) Use polite, instructional Korean (e.g. 합니다/하세요 style).
2) Keep the tone consistent with the existing Korean FastAPI docs.
- Use polite, instructional Korean (e.g. 합니다/하세요 style).
- Keep the tone consistent with the existing Korean FastAPI docs.
### Headings
1) Follow existing Korean heading style (short, action-oriented headings like “확인하기”).
2) Do not add trailing punctuation to headings.
- Follow existing Korean heading style (short, action-oriented headings like “확인하기”).
- Do not add trailing punctuation to headings.
### Quotes
1) Keep quote style consistent with the existing Korean docs.
2) Never change quotes inside inline code, code blocks, URLs, or file paths.
- Keep quote style consistent with the existing Korean docs.
- Never change quotes inside inline code, code blocks, URLs, or file paths.
### Ellipsis
1) Keep ellipsis style consistent with existing Korean docs (often `...`).
2) Never change `...` in code, URLs, or CLI examples.
- Keep ellipsis style consistent with existing Korean docs (often `...`).
- Never change `...` in code, URLs, or CLI examples.
### Preferred translations / glossary

View File

@@ -4,6 +4,6 @@ This page hasnt been translated into your language yet. 🌍
Were currently switching to an automated translation system 🤖, which will help keep all translations complete and up to date.
Learn more: [Contributing Translations](https://fastapi.tiangolo.com/contributing/#translations){.internal-link target=_blank}
Learn more: [Contributing - Translations](https://fastapi.tiangolo.com/contributing/#translations){.internal-link target=_blank}
///

View File

@@ -14,15 +14,15 @@ When translating documentation into Portuguese, use neutral and widely understan
For the next terms, use the following translations:
* «/// check»: «/// check | Verifique»
* «/// danger»: «/// danger | Cuidado»
* «/// info»: «/// info | Informação»
* «/// note | Technical Details»: «/// note | Detalhes Técnicos»
* «/// info | Very Technical Details»: «/// note | Detalhes Técnicos Avançados»
* «/// note»: «/// note | Nota»
* «/// tip»: «/// tip | Dica»
* «/// warning»: «/// warning | Atenção»
* «(you should)»: «(você deveria)»
* /// check: /// check | Verifique
* /// danger: /// danger | Cuidado
* /// info: /// info | Informação
* /// note | Technical Details: /// note | Detalhes Técnicos
* /// info | Very Technical Details: /// note | Detalhes Técnicos Avançados
* /// note: /// note | Nota
* /// tip: /// tip | Dica
* /// warning: /// warning | Atenção
* (you should): (você deveria)
* async context manager: gerenciador de contexto assíncrono
* autocomplete: autocompletar
* autocompletion: preenchimento automático

View File

@@ -6,22 +6,22 @@ Language code: tr.
### Grammar and tone
1) Use instructional Turkish, consistent with existing Turkish docs.
2) Use imperative/guide language when appropriate (e.g. “açalım”, “gidin”, “kopyalayalım”).
- Use instructional Turkish, consistent with existing Turkish docs.
- Use imperative/guide language when appropriate (e.g. “açalım”, “gidin”, “kopyalayalım”).
### Headings
1) Follow existing Turkish heading style (Title Case where used; no trailing period).
- Follow existing Turkish heading style (Title Case where used; no trailing period).
### Quotes
1) Keep quote style consistent with the existing Turkish docs (they frequently use ASCII quotes in prose).
2) Never change quotes inside inline code, code blocks, URLs, or file paths.
- Alıntı stili mevcut Türkçe dokümanlarla tutarlı tutun (genellikle metin içinde ASCII tırnak işaretleri kullanılır).
- Satır içi kod, kod blokları, URL'ler veya dosya yolları içindeki tırnak işaretlerini asla değiştirmeyin.
### Ellipsis
1) Keep ellipsis style consistent with existing Turkish docs.
2) Never change `...` in code, URLs, or CLI examples.
- Üç nokta (...) stili mevcut Türkçe dokümanlarla tutarlı tutun.
- Kod, URL veya CLI örneklerindeki `...` ifadesini asla değiştirmeyin.
### Preferred translations / glossary
@@ -39,8 +39,8 @@ Do not translate technical terms like path, route, request, response, query, bod
### `///` admonitions
1) Keep the admonition keyword in English (do not translate `note`, `tip`, etc.).
2) If a title is present, prefer these canonical titles:
- Keep the admonition keyword in English (do not translate `note`, `tip`, etc.).
- If a title is present, prefer these canonical titles:
- `/// note | Not`
- `/// note | Teknik Detaylar`

View File

@@ -6,23 +6,23 @@ Language code: uk.
### Grammar and tone
1) Use polite/formal address consistent with existing Ukrainian docs (use “ви/ваш”).
2) Keep the tone concise and technical.
- Use polite/formal address consistent with existing Ukrainian docs (use “ви/ваш”).
- Keep the tone concise and technical.
### Headings
1) Follow existing Ukrainian heading style; keep headings short and instructional.
2) Do not add trailing punctuation to headings.
- Follow existing Ukrainian heading style; keep headings short and instructional.
- Do not add trailing punctuation to headings.
### Quotes
1) Prefer Ukrainian guillemets «…» for quoted terms in prose, matching existing Ukrainian docs.
2) Never change quotes inside inline code, code blocks, URLs, or file paths.
- Prefer Ukrainian guillemets «…» for quoted terms in prose, matching existing Ukrainian docs.
- Never change quotes inside inline code, code blocks, URLs, or file paths.
### Ellipsis
1) Keep ellipsis style consistent with existing Ukrainian docs.
2) Never change `...` in code, URLs, or CLI examples.
- Keep ellipsis style consistent with existing Ukrainian docs.
- Never change `...` in code, URLs, or CLI examples.
### Preferred translations / glossary
@@ -35,8 +35,8 @@ Use the following preferred translations when they apply in documentation prose:
### `///` admonitions
1) Keep the admonition keyword in English (do not translate `note`, `tip`, etc.).
2) If a title is present, prefer these canonical titles (choose one canonical form where variants exist):
- Keep the admonition keyword in English (do not translate `note`, `tip`, etc.).
- If a title is present, prefer these canonical titles (choose one canonical form where variants exist):
- `/// note | Примітка`
- `/// note | Технічні деталі`

View File

@@ -6,30 +6,30 @@ Language code: zh-hant.
### Grammar and tone
1) Use clear, concise technical Traditional Chinese consistent with existing docs.
2) Address the reader naturally (commonly using “你/你的”).
- Use clear, concise technical Traditional Chinese consistent with existing docs.
- Address the reader naturally (commonly using “你/你的”).
### Headings
1) Follow existing Traditional Chinese heading style (short and descriptive).
2) Do not add trailing punctuation to headings.
- Follow existing Traditional Chinese heading style (short and descriptive).
- Do not add trailing punctuation to headings.
### Quotes and punctuation
1) Keep punctuation style consistent with existing Traditional Chinese docs (they often mix English terms like “FastAPI” with Chinese text).
2) Never change punctuation inside inline code, code blocks, URLs, or file paths.
3) For more details, please follow the [Chinese Copywriting Guidelines](https://github.com/sparanoid/chinese-copywriting-guidelines).
- Keep punctuation style consistent with existing Traditional Chinese docs (they often mix English terms like “FastAPI” with Chinese text).
- Never change punctuation inside inline code, code blocks, URLs, or file paths.
- For more details, please follow the [Chinese Copywriting Guidelines](https://github.com/sparanoid/chinese-copywriting-guidelines).
### Ellipsis
1) Keep ellipsis style consistent within each document, prefer `...` over `……`.
2) Never change ellipsis in code, URLs, or CLI examples.
- Keep ellipsis style consistent within each document, prefer `...` over `……`.
- Never change ellipsis in code, URLs, or CLI examples.
### Preferred translations / glossary
1. Should avoid using simplified Chinese characters and terms. Always examine if the translation can be easily comprehended by the Traditional Chinese readers.
2. For some Python-specific terms like "pickle", "list", "dict" etc, we don't have to translate them.
3. Use the following preferred translations when they apply in documentation prose:
- Should avoid using simplified Chinese characters and terms. Always examine if the translation can be easily comprehended by the Traditional Chinese readers.
- For some Python-specific terms like "pickle", "list", "dict" etc, we don't have to translate them.
- Use the following preferred translations when they apply in documentation prose:
- request (HTTP): 請求
- response (HTTP): 回應
@@ -50,5 +50,11 @@ Notes:
- `details` blocks exist; keep `/// details` as-is and translate only the title after `|`.
- Example canonical titles used in existing docs:
- `/// details | 上述指令的含義`
- `/// details | 關於 `requirements.txt``
```
/// details | 上述指令的含義
```
```
/// details | 關於 `requirements.txt`
```

View File

@@ -6,24 +6,24 @@ Language code: zh.
### Grammar and tone
1) Use clear, concise technical Chinese consistent with existing docs.
2) Address the reader naturally (commonly using “你/你的”).
- Use clear, concise technical Chinese consistent with existing docs.
- Address the reader naturally (commonly using “你/你的”).
### Headings
1) Follow existing Simplified Chinese heading style (short and descriptive).
2) Do not add trailing punctuation to headings.
3) If a heading contains only the name of a FastAPI feature, do not translate it.
- Follow existing Simplified Chinese heading style (short and descriptive).
- Do not add trailing punctuation to headings.
- If a heading contains only the name of a FastAPI feature, do not translate it.
### Quotes and punctuation
1) Keep punctuation style consistent with existing Simplified Chinese docs (they often mix English terms like “FastAPI” with Chinese text).
2) Never change punctuation inside inline code, code blocks, URLs, or file paths.
- Keep punctuation style consistent with existing Simplified Chinese docs (they often mix English terms like “FastAPI” with Chinese text).
- Never change punctuation inside inline code, code blocks, URLs, or file paths.
### Ellipsis
1) Keep ellipsis style consistent within each document, prefer `...` over `……`.
2) Never change ellipsis in code, URLs, or CLI examples.
- Keep ellipsis style consistent within each document, prefer `...` over `……`.
- Never change ellipsis in code, URLs, or CLI examples.
### Preferred translations / glossary
@@ -36,8 +36,8 @@ Use the following preferred translations when they apply in documentation prose:
### `///` admonitions
1) Keep the admonition keyword in English (do not translate `note`, `tip`, etc.).
2) If a title is present, prefer these canonical titles:
- Keep the admonition keyword in English (do not translate `note`, `tip`, etc.).
- If a title is present, prefer these canonical titles:
- `/// tip | 提示`
- `/// note | 注意`

View File

@@ -0,0 +1,528 @@
### Your task
Translate an English original content to a target language.
The original content is written in Markdown, write the translation in Markdown as well.
The original content will be surrounded by triple percentage signs (%%%). Do not include the triple percentage signs in the translation.
### Technical terms in English
For technical terms in English that don't have a common translation term, use the original term in English.
### Content of code snippets
Do not translate the content of code snippets, keep the original in English. For example, `list`, `dict`, keep them as is.
### Content of code blocks
Do not translate the content of code blocks, except for comments in the language which the code block uses.
Examples:
Source (English) - The code block is a bash code example with one comment:
```bash
# Print greeting
echo "Hello, World!"
```
Result (German):
```bash
# Gruß ausgeben
echo "Hello, World!"
```
Source (English) - The code block is a console example containing HTML tags. No comments, so nothing to change here:
```console
$ <font color="#4E9A06">fastapi</font> run <u style="text-decoration-style:solid">main.py</u>
<span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting server
Searching for package file structure
```
Result (German):
```console
$ <font color="#4E9A06">fastapi</font> run <u style="text-decoration-style:solid">main.py</u>
<span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting server
Searching for package file structure
```
Source (English) - The code block is a console example containing 5 comments:
```console
// Go to the home directory
$ cd
// Create a directory for all your code projects
$ mkdir code
// Enter into that code directory
$ cd code
// Create a directory for this project
$ mkdir awesome-project
// Enter into that project directory
$ cd awesome-project
```
Result (German):
```console
// Gehe zum Home-Verzeichnis
$ cd
// Erstelle ein Verzeichnis für alle Ihre Code-Projekte
$ mkdir code
// Gehe in dieses Code-Verzeichnis
$ cd code
// Erstelle ein Verzeichnis für dieses Projekt
$ mkdir awesome-project
// Gehe in dieses Projektverzeichnis
$ cd awesome-project
```
If there is an existing translation and its Mermaid diagram is in sync with the Mermaid diagram in the English source, except a few translated words, then use the Mermaid diagram of the existing translation. The human editor of the translation translated these words in the Mermaid diagram. Keep these translations, do not revert them back to the English source.
Example:
Source (English):
```mermaid
flowchart LR
subgraph global[global env]
harry-1[harry v1]
end
subgraph stone-project[philosophers-stone project]
stone(philosophers-stone) -->|requires| harry-1
end
```
Existing translation (German) - has three translations:
```mermaid
flowchart LR
subgraph global[globale Umgebung]
harry-1[harry v1]
end
subgraph stone-project[philosophers-stone-Projekt]
stone(philosophers-stone) -->|benötigt| harry-1
end
```
Result (German) - you change nothing:
```mermaid
flowchart LR
subgraph global[globale Umgebung]
harry-1[harry v1]
end
subgraph stone-project[philosophers-stone-Projekt]
stone(philosophers-stone) -->|benötigt| harry-1
end
```
### Special blocks
There are special blocks of notes, tips and others that look like:
/// note
Here goes a note
///
To translate it, keep the same line and add the translation after a vertical bar.
For example, if you were translating to Spanish, you would write:
/// note | Nota
Some examples in Spanish:
Source (English):
/// tip
Result (Spanish):
/// tip | Consejo
Source (English):
/// details | Preview
Result (Spanish):
/// details | Vista previa
### Tab blocks
There are special blocks surrounded by four slashes (////). They mark text, which will be rendered as part of a tab in the final document. The scheme is:
//// tab | {tab title}
{tab content, may span many lines}
////
Keep everything before the vertical bar (|) as is, including the vertical bar. Translate the tab title. Translate the tab content, applying the rules you know. Keep the four block closing slashes as is.
Examples:
Source (English):
//// tab | Python 3.8+ non-Annotated
Hello
////
Result (German):
//// tab | Python 3.8+ nicht annotiert
Hallo
////
Source (English) - Here there is nothing to translate in the tab title:
//// tab | Linux, macOS, Windows Bash
Hello again
////
Result (German):
//// tab | Linux, macOS, Windows Bash
Hallo wieder
////
### Headings
Every Markdown heading in the English text (all levels) ends with a part inside curly brackets. This part denotes the hash of this heading, which is used in links to this heading. In translations, translate the heading, but do not translate this hash part, so that links do not break.
Examples of how to translate a heading:
Source (English):
```
## Alternative API docs { #alternative-api-docs }
```
Result (Spanish):
```
## Documentación de la API alternativa { #alternative-api-docs }
```
Source (English):
```
### Example { #example }
```
Result (German):
```
### Beispiel { #example }
```
### Links
Use the following rules for links (apply both to Markdown-style links ([text](url)) and to HTML-style <a href="url">text</a> tags):
- For relative URLs, only translate the link text. Do not translate the URL or its parts.
Example:
Source (English):
```
[One of the fastest Python frameworks available](#performance)
```
Result (German):
```
[Eines der schnellsten verfügbaren Python-Frameworks](#performance)
```
- For absolute URLs which DO NOT start EXACTLY with https://fastapi.tiangolo.com, only translate the link text and leave the URL unchanged.
Example:
Source (English):
```
<a href="https://sqlmodel.tiangolo.com/" class="external-link" target="_blank">SQLModel docs</a>
```
Result (German):
```
<a href="https://sqlmodel.tiangolo.com/" class="external-link" target="_blank">SQLModel-Dokumentation</a>
```
- For absolute URLs which DO start EXACTLY with https://fastapi.tiangolo.com, only translate the link text and change the URL by adding the language code (https://fastapi.tiangolo.com/{language_code}[rest part of the url]).
Example:
Source (English):
```
<a href="https://fastapi.tiangolo.com/tutorial/path-params/#documentation" class="external-link" target="_blank">Documentation</a>
```
Result (Spanish):
```
<a href="https://fastapi.tiangolo.com/es/tutorial/path-params/#documentation" class="external-link" target="_blank">Documentación</a>
```
- Do not add language codes for URLs that point to static assets (e.g., images, CSS, JavaScript).
Example:
Source (English):
```
<a href="https://fastapi.tiangolo.com/img/something.jpg" class="external-link" target="_blank">Something</a>
```
Result (Spanish):
```
<a href="https://fastapi.tiangolo.com/img/something.jpg" class="external-link" target="_blank">Algo</a>
```
- For internal links, only translate link text.
Example:
Source (English):
```
[Create Pull Requests](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}
```
Result (German):
```
[Pull Requests erzeugen](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}
```
- Do not translate anchor fragments in links (the part after `#`), as they must remain the same to work correctly.
- If an existing translation has a link with an anchor fragment different to the anchor fragment in the English source, then this is an error. Fix this by using the anchor fragment of the English source.
Example:
Source (English):
```
[Body - Multiple Parameters: Singular values in body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}
```
Existing wrong translation (German) - notice the wrongly translated anchor fragment:
```
[Body - Mehrere Parameter: Einfache Werte im Body](body-multiple-params.md#einzelne-werte-im-body){.internal-link target=_blank}.
```
Result (German) - you fix the anchor fragment:
```
[Body - Mehrere Parameter: Einfache Werte im Body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}.
```
- Do not add anchor fragments at will, even if this makes sense. If the English source has no anchor, don't add one.
Example:
Source (English):
```
Create a [virtual environment](../virtual-environments.md){.internal-link target=_blank}
```
Wrong translation in German - Anchor added to the URL.
```
Erstelle eine [virtuelle Umgebung](../virtual-environments.md#create-a-virtual-environment){.internal-link target=_blank}
```
Good translation (German) - URL stays like in the English source.
```
Erstelle eine [Virtuelle Umgebung](../virtual-environments.md){.internal-link target=_blank}
```
### HTML abbr elements
Translate HTML abbr elements (`<abbr title="description">text</abbr>`) as follows:
- If the text surrounded by the abbr element is an abbreviation (the text may be surrounded by further HTML or Markdown markup or quotes, for example <code>text</code> or `text` or "text", ignore that further markup when deciding if the text is an abbreviation), and if the description (the text inside the title attribute) contains the full phrase for this abbreviation, then append a dash (-) to the full phrase, followed by the translation of the full phrase.
Conversion scheme:
Source (English):
```
<abbr title="{full phrase}">{abbreviation}</abbr>
```
Result:
```
<abbr title="{full phrase} - {translation of full phrase}">{abbreviation}</abbr>
```
Examples:
Source (English):
```
<abbr title="Internet of Things">IoT</abbr>
<abbr title="Central Processing Unit">CPU</abbr>
<abbr title="too long; didn't read"><strong>TL;DR:</strong></abbr>
```
Result (German):
```
<abbr title="Internet of Things - Internet der Dinge">IoT</abbr>
<abbr title="Central Processing Unit - Zentrale Verarbeitungseinheit">CPU</abbr>
<abbr title="too long; didn't read - zu lang; hab's nicht gelesen"><strong>TL;DR:</strong></abbr>
```
- If the language to which you translate mostly uses the letters of the ASCII char set (for example Spanish, French, German, but not Russian, Chinese) and if the translation of the full phrase is identical to, or starts with the same letters as the original full phrase, then only give the translation of the full phrase.
Conversion scheme:
Source (English):
```
<abbr title="{full phrase}">{abbreviation}</abbr>
```
Result:
```
<abbr title="{translation of full phrase}">{abbreviation}</abbr>
```
Examples:
Source (English):
```
<abbr title="JSON Web Tokens">JWT</abbr>
<abbr title="Enumeration">Enum</abbr>
<abbr title="Asynchronous Server Gateway Interface">ASGI</abbr>
```
Result (German):
```
<abbr title="JSON Web Tokens">JWT</abbr>
<abbr title="Enumeration">Enum</abbr>
<abbr title="Asynchrones Server-Gateway-Interface">ASGI</abbr>
```
- If the description is not a full phrase for an abbreviation which the abbr element surrounds, but some other information, then just translate the description.
Conversion scheme:
Source (English):
```
<abbr title="{description}">{text}</abbr>
```
Result:
```
<abbr title="{translation of description}">{translation of text}</abbr>
```
Examples:
Source (English):
```
<abbr title="also known as: endpoints, routes">path</abbr>
<abbr title="a program that checks for code errors">linter</abbr>
<abbr title="converting the string that comes from an HTTP request into Python data">parsing</abbr>
<abbr title="before 2023-03">0.95.0</abbr>
<abbr title="2023-08-26">at the time of writing this</abbr>
```
Result (German):
```
<abbr title="auch bekannt als: Endpunkte, Routen">Pfad</abbr>
<abbr title="Programm das auf Fehler im Code prüft">Linter</abbr>
<abbr title="Konvertieren des Strings eines HTTP-Requests in Python-Daten">Parsen</abbr>
<abbr title="vor 2023-03">0.95.0</abbr>
<abbr title="2023-08-26">zum Zeitpunkt als das hier geschrieben wurde</abbr>
```
- If the text surrounded by the abbr element is an abbreviation and the description contains both the full phrase for that abbreviation, and other information, separated by a colon (`:`), then append a dash (`-`) and the translation of the full phrase to the original full phrase and translate the other information.
Conversion scheme:
Source (English):
```
<abbr title="{full phrase}: {other information}">{abbreviation}</abbr>
```
Result:
```
<abbr title="{full phrase} - {translation of full phrase}: {translation of other information}">{abbreviation}</abbr>
```
Examples:
Source (English):
```
<abbr title="Input/Output: disk reading or writing, network communication.">I/O</abbr>
<abbr title="Content Delivery Network: service, that provides static files.">CDN</abbr>
<abbr title="Integrated Development Environment: similar to a code editor">IDE</abbr>
```
Result (German):
```
<abbr title="Input/Output - Eingabe/Ausgabe: Lesen oder Schreiben auf der Festplatte, Netzwerkkommunikation.">I/O</abbr>
<abbr title="Content Delivery Network - Inhalte auslieferndes Netzwerk: Dienst, der statische Dateien bereitstellt.">CDN</abbr>
<abbr title="Integrated Development Environment - Integrierte Entwicklungsumgebung: Ähnlich einem Code-Editor">IDE</abbr>
```
- You can leave the original full phrase away, if the translated full phrase is identical or starts with the same letters as the original full phrase.
Conversion scheme:
Source (English):
```
<abbr title="{full phrase}: {information}">{abbreviation}</abbr>
```
Result:
```
<abbr title="{translation of full phrase}: {translation of information}">{abbreviation}</abbr>
```
Example:
Source (English):
```
<abbr title="Object Relational Mapper: a fancy term for a library where some classes represent SQL tables and instances represent rows in those tables">ORM</abbr>
```
Result (German):
```
<abbr title="Objektrelationaler Mapper: Ein Fachbegriff für eine Bibliothek, in der einige Klassen SQL-Tabellen und Instanzen Zeilen in diesen Tabellen darstellen">ORM</abbr>
```
- If there is an existing translation, and it has ADDITIONAL abbr elements in a sentence, and these additional abbr elements do not exist in the related sentence in the English text, then KEEP those additional abbr elements in the translation. Do not remove them. Except when you remove the whole sentence from the translation, because the whole sentence was removed from the English text, then also remove the abbr element. The reasoning for this rule is, that such additional abbr elements are manually added by the human editor of the translation, in order to translate or explain an English word to the human readers of the translation. These additional abbr elements would not make sense in the English text, but they do make sense in the translation. So keep them in the translation, even though they are not part of the English text. This rule only applies to abbr elements.
- Apply above rules also when there is an existing translation! Make sure that all title attributes in abbr elements get properly translated or updated, using the schemes given above. However, leave the ADDITIONAL abbr's described above alone. Do not change their formatting or content.

View File

@@ -25,650 +25,8 @@ non_translated_sections = (
"contributing.md",
)
general_prompt = """
### About literal text in this prompt
1) In the following instructions (after I say: `The above rules are in effect now`) the two characters `«` and `»` will be used to surround LITERAL TEXT, which is text or characters you shall interpret literally. The `«` and the `»` are not part of the literal text, they are the meta characters denoting it.
2) Furthermore, text surrounded by `«««` and `»»»` is a BLOCK OF LITERAL TEXT which spans multiple lines. To get its content, dedent all lines of the block until the `«««` and `»»»` are at column zero, then remove the newline (`\n`) after the `«««` and the newline before the `»»»`. The `«««` and the `»»»` are not part of the literal text block, they are the meta characters denoting it.
3) If you see backticks or any other quotes inside literal text inside `«` and `»` or inside blocks of literal text inside `«««` and `»»»` then interpret them as literal characters, do NOT interpret them as meta characters.
The above rules are in effect now.
### Definitions of terms used in this prompt
"backtick"
The character «`»
Unicode U+0060 (GRAVE ACCENT)
"single backtick"
A single backtick «`»
"triple backticks"
Three backticks in a row «```»
"neutral double quote"
The character «"»
Unicode U+0022 (QUOTATION MARK)
"neutral single quote"
The character «'»
Unicode U+0027 (APOSTROPHE)
"English double typographic quotes"
The characters «“» and «”»
Unicode U+201C (LEFT DOUBLE QUOTATION MARK) and Unicode U+201D (RIGHT DOUBLE QUOTATION MARK)
"English single typographic quotes"
The characters «‘» and «’»
Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and Unicode U+2019 (RIGHT SINGLE QUOTATION MARK)
"code snippet"
Also called "inline code". Text in a Markdown document which is surrounded by single backticks. A paragraph in a Markdown document can have a more than one code snippet.
Example:
«««
`i am a code snippet`
»»»
Example:
«««
`first code snippet` `second code snippet` `third code snippet`
»»»
"code block"
Text in a Markdown document which is surrounded by triple backticks. Spreads multiple lines.
Example:
«««
```
Hello
World
```
»»»
Example:
«««
```python
print("hello World")
```
»»»
"HTML element"
a HTML opening tag e.g. «<div>» and a HTML closing tag e.g. «</div>» surrounding text or other HTML elements.
### Your task
Translate an English text the original content to a target language.
The original content is written in Markdown, write the translation in Markdown as well.
The original content will be surrounded by triple percentage signs («%%%»). Do not include the triple percentage signs in the translation.
### Technical terms in English
For technical terms in English that don't have a common translation term, use the original term in English.
### Content of code snippets
Do not translate the content of code snippets, keep the original in English. For example, «`list`», «`dict`», keep them as is.
### Content of code blocks
Do not translate the content of code blocks, except for comments in the language which the code block uses.
Examples:
Source (English) The code block is a bash code example with one comment:
«««
```bash
# Print greeting
echo "Hello, World!"
```
»»»
Result (German):
«««
```bash
# Gruß ausgeben
echo "Hello, World!"
```
»»»
Source (English) The code block is a console example containing HTML tags. No comments, so nothing to change here:
«««
```console
$ <font color="#4E9A06">fastapi</font> run <u style="text-decoration-style:solid">main.py</u>
<span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting server
Searching for package file structure
```
»»»
Result (German):
«««
```console
$ <font color="#4E9A06">fastapi</font> run <u style="text-decoration-style:solid">main.py</u>
<span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting server
Searching for package file structure
```
»»»
Source (English) The code block is a console example containing 5 comments:
«««
```console
// Go to the home directory
$ cd
// Create a directory for all your code projects
$ mkdir code
// Enter into that code directory
$ cd code
// Create a directory for this project
$ mkdir awesome-project
// Enter into that project directory
$ cd awesome-project
```
»»»
Result (German):
«««
```console
// Gehe zum Home-Verzeichnis
$ cd
// Erstelle ein Verzeichnis für alle Ihre Code-Projekte
$ mkdir code
// Gehe in dieses Code-Verzeichnis
$ cd code
// Erstelle ein Verzeichnis für dieses Projekt
$ mkdir awesome-project
// Gehe in dieses Projektverzeichnis
$ cd awesome-project
```
»»»
If there is an existing translation and its Mermaid diagram is in sync with the Mermaid diagram in the English source, except a few translated words, then use the Mermaid diagram of the existing translation. The human editor of the translation translated these words in the Mermaid diagram. Keep these translations, do not revert them back to the English source.
Example:
Source (English):
«««
```mermaid
flowchart LR
subgraph global[global env]
harry-1[harry v1]
end
subgraph stone-project[philosophers-stone project]
stone(philosophers-stone) -->|requires| harry-1
end
```
»»»
Existing translation (German) has three translations:
«««
```mermaid
flowchart LR
subgraph global[globale Umgebung]
harry-1[harry v1]
end
subgraph stone-project[philosophers-stone-Projekt]
stone(philosophers-stone) -->|benötigt| harry-1
end
```
»»»
Result (German) you change nothing:
«««
```mermaid
flowchart LR
subgraph global[globale Umgebung]
harry-1[harry v1]
end
subgraph stone-project[philosophers-stone-Projekt]
stone(philosophers-stone) -->|benötigt| harry-1
end
```
»»»
### Special blocks
There are special blocks of notes, tips and others that look like:
«««
/// note
»»»
To translate it, keep the same line and add the translation after a vertical bar.
For example, if you were translating to Spanish, you would write:
«««
/// note | Nota
»»»
Some examples in Spanish:
Source:
«««
/// tip
»»»
Result:
«««
/// tip | Consejo
»»»
Source:
«««
/// details | Preview
»»»
Result:
«««
/// details | Vista previa
»»»
### Tab blocks
There are special blocks surrounded by four slashes («////»). They mark text, which will be rendered as part of a tab in the final document. The scheme is:
//// tab | {tab title}
{tab content, may span many lines}
////
Keep everything before the vertical bar («|») as is, including the vertical bar. Translate the tab title. Translate the tab content, applying the rules you know. Keep the four block closing slashes as is.
Examples:
Source (English):
«««
//// tab | Python 3.8+ non-Annotated
Hello
////
»»»
Result (German):
«««
//// tab | Python 3.8+ nicht annotiert
Hallo
////
»»»
Source (English) Here there is nothing to translate in the tab title:
«««
//// tab | Linux, macOS, Windows Bash
Hello again
////
»»»
Result (German):
«««
//// tab | Linux, macOS, Windows Bash
Hallo wieder
////
»»»
### Headings
Every Markdown heading in the English text (all levels) ends with a part inside curly brackets. This part denotes the hash of this heading, which is used in links to this heading. In translations, translate the heading, but do not translate this hash part, so that links do not break.
Examples of how to translate a heading:
Source (English):
«««
## Alternative API docs { #alternative-api-docs }
»»»
Result (Spanish):
«««
## Documentación de la API alternativa { #alternative-api-docs }
»»»
Source (English):
«««
### Example { #example }
»»»
Result (German):
«««
### Beispiel { #example }
»»»
### Links
Use the following rules for links (apply both to Markdown-style links ([text](url)) and to HTML-style <a> tags):
1) For relative URLs, only translate link text. Do not translate the URL or its parts
Example:
Source (English):
«««
[One of the fastest Python frameworks available](#performance)
»»»
Result (German):
«««
[Eines der schnellsten verfügbaren Python-Frameworks](#performance)
»»»
2) For absolute URLs which DO NOT start EXACTLY with «https://fastapi.tiangolo.com», only translate link text and leave the URL unchanged.
Example:
Source (English):
«««
<a href="https://sqlmodel.tiangolo.com/" class="external-link" target="_blank">SQLModel docs</a>
»»»
Result (German):
«««
<a href="https://sqlmodel.tiangolo.com/" class="external-link" target="_blank">SQLModel-Dokumentation</a>
»»»
3) For absolute URLs which DO start EXACTLY with «https://fastapi.tiangolo.com», only translate link text and change the URL by adding language code («https://fastapi.tiangolo.com/{language_code}[rest part of the url]»).
Example:
Source (English):
«««
<a href="https://fastapi.tiangolo.com/tutorial/path-params/#documentation" class="external-link" target="_blank">Documentation</a>
»»»
Result (Spanish):
«««
<a href="https://fastapi.tiangolo.com/es/tutorial/path-params/#documentation" class="external-link" target="_blank">Documentación</a>
»»»
3.1) Do not add language codes for URLs that point to static assets (e.g., images, CSS, JavaScript).
Example:
Source (English):
«««
<a href="https://fastapi.tiangolo.com/img/something.jpg" class="external-link" target="_blank">Something</a>
»»»
Result (Spanish):
«««
<a href="https://fastapi.tiangolo.com/img/something.jpg" class="external-link" target="_blank">Algo</a>
»»»
4) For internal links, only translate link text.
Example:
Source (English):
«««
[Create Pull Requests](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}
»»»
Result (German):
«««
[Pull Requests erzeugen](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}
»»»
5) Do not translate anchor fragments in links (the part after «#»), as they must remain the same to work correctly.
5.1) If an existing translation has a link with an anchor fragment different to the anchor fragment in the English source, then this is an error. Fix this by using the anchor fragment of the English source.
Example:
Source (English):
«««
[Body - Multiple Parameters: Singular values in body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}
»»»
Existing wrong translation (German) notice the wrongly translated anchor fragment:
«««
[Body Mehrere Parameter: Einfache Werte im Body](body-multiple-params.md#einzelne-werte-im-body){.internal-link target=_blank}.
»»»
Result (German) you fix the anchor fragment:
«««
[Body Mehrere Parameter: Einfache Werte im Body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}.
»»»
5.2) Do not add anchor fragments at will, even if this makes sense. If the English source has no anchor, don't add one.
Example:
Source (English):
«««
Create a [virtual environment](../virtual-environments.md){.internal-link target=_blank}
»»»
Wrong translation (German) Anchor added to the URL.
«««
Erstelle eine [virtuelle Umgebung](../virtual-environments.md#create-a-virtual-environment){.internal-link target=_blank}
»»»
Good translation (German) URL stays like in the English source.
«««
Erstelle eine [Virtuelle Umgebung](../virtual-environments.md){.internal-link target=_blank}
»»»
### HTML abbr elements
Translate HTML abbr elements («<abbr title="description">text</abbr>») as follows:
1) If the text surrounded by the abbr element is an abbreviation (the text may be surrounded by further HTML or Markdown markup or quotes, for example «<code>text</code>» or «`text`» or «"text"», ignore that further markup when deciding if the text is an abbreviation), and if the description (the text inside the title attribute) contains the full phrase for this abbreviation, then append a dash («–») to the full phrase, followed by the translation of the full phrase.
Conversion scheme:
Source (English):
<abbr title="{full phrase}">{abbreviation}</abbr>
Result:
<abbr title="{full phrase} {translation of full phrase}">{abbreviation}</abbr>
Examples:
Source (English):
«««
<abbr title="Internet of Things">IoT</abbr>
<abbr title="Central Processing Unit">CPU</abbr>
<abbr title="too long; didn't read"><strong>TL;DR:</strong></abbr>
»»»
Result (German):
«««
<abbr title="Internet of Things Internet der Dinge">IoT</abbr>
<abbr title="Central Processing Unit Zentrale Verarbeitungseinheit">CPU</abbr>
<abbr title="too long; didn't read zu lang; hab's nicht gelesen"><strong>TL;DR:</strong></abbr>
»»»
1.1) If the language to which you translate mostly uses the letters of the ASCII char set (for example Spanish, French, German, but not Russian, Chinese) and if the translation of the full phrase is identical to, or starts with the same letters as the original full phrase, then only give the translation of the full phrase.
Conversion scheme:
Source (English):
<abbr title="{full phrase}">{abbreviation}</abbr>
Result:
<abbr title="{translation of full phrase}">{abbreviation}</abbr>
Examples:
Source (English):
«««
<abbr title="JSON Web Tokens">JWT</abbr>
<abbr title="Enumeration">Enum</abbr>
<abbr title="Asynchronous Server Gateway Interface">ASGI</abbr>
»»»
Result (German):
«««
<abbr title="JSON Web Tokens">JWT</abbr>
<abbr title="Enumeration">Enum</abbr>
<abbr title="Asynchrones Server-Gateway-Interface">ASGI</abbr>
»»»
2) If the description is not a full phrase for an abbreviation which the abbr element surrounds, but some other information, then just translate the description.
Conversion scheme:
Source (English):
<abbr title="{description}">{text}</abbr>
Result:
<abbr title="{translation of description}">{translation of text}</abbr>
Examples:
Source (English):
«««
<abbr title="also known as: endpoints, routes">path</abbr>
<abbr title="a program that checks for code errors">linter</abbr>
<abbr title="converting the string that comes from an HTTP request into Python data">parsing</abbr>
<abbr title="before 2023-03">0.95.0</abbr>
<abbr title="2023-08-26">at the time of writing this</abbr>
»»»
Result (German):
«««
<abbr title="auch bekannt als: Endpunkte, Routen">Pfad</abbr>
<abbr title="Programm das auf Fehler im Code prüft">Linter</abbr>
<abbr title="Konvertieren des Strings eines HTTP-Requests in Python-Daten">Parsen</abbr>
<abbr title="vor 2023-03">0.95.0</abbr>
<abbr title="2023-08-26">zum Zeitpunkt als das hier geschrieben wurde</abbr>
»»»
3) If the text surrounded by the abbr element is an abbreviation and the description contains both the full phrase for that abbreviation, and other information, separated by a colon («:»), then append a dash («–») and the translation of the full phrase to the original full phrase and translate the other information.
Conversion scheme:
Source (English):
<abbr title="{full phrase}: {other information}">{abbreviation}</abbr>
Result:
<abbr title="{full phrase} {translation of full phrase}: {translation of other information}">{abbreviation}</abbr>
Examples:
Source (English):
«««
<abbr title="Input/Output: disk reading or writing, network communication.">I/O</abbr>
<abbr title="Content Delivery Network: service, that provides static files.">CDN</abbr>
<abbr title="Integrated Development Environment: similar to a code editor">IDE</abbr>
»»»
Result (German):
«««
<abbr title="Input/Output Eingabe/Ausgabe: Lesen oder Schreiben auf der Festplatte, Netzwerkkommunikation.">I/O</abbr>
<abbr title="Content Delivery Network Inhalte auslieferndes Netzwerk: Dienst, der statische Dateien bereitstellt.">CDN</abbr>
<abbr title="Integrated Development Environment Integrierte Entwicklungsumgebung: Ähnlich einem Code-Editor">IDE</abbr>
»»»
3.1) Like in rule 2.1, you can leave the original full phrase away, if the translated full phrase is identical or starts with the same letters as the original full phrase.
Conversion scheme:
Source (English):
<abbr title="{full phrase}: {information}">{abbreviation}</abbr>
Result:
<abbr title="{translation of full phrase}: {translation of information}">{abbreviation}</abbr>
Example:
Source (English):
«««
<abbr title="Object Relational Mapper: a fancy term for a library where some classes represent SQL tables and instances represent rows in those tables">ORM</abbr>
»»»
Result (German):
«««
<abbr title="Objektrelationaler Mapper: Ein Fachbegriff für eine Bibliothek, in der einige Klassen SQL-Tabellen und Instanzen Zeilen in diesen Tabellen darstellen">ORM</abbr>
»»»
4) If there is an existing translation, and it has ADDITIONAL abbr elements in a sentence, and these additional abbr elements do not exist in the related sentence in the English text, then KEEP those additional abbr elements in the translation. Do not remove them. Except when you remove the whole sentence from the translation, because the whole sentence was removed from the English text, then also remove the abbr element. The reasoning for this rule is, that such additional abbr elements are manually added by the human editor of the translation, in order to translate or explain an English word to the human readers of the translation. These additional abbr elements would not make sense in the English text, but they do make sense in the translation. So keep them in the translation, even though they are not part of the English text. This rule only applies to abbr elements.
5) Apply above rules also when there is an existing translation! Make sure that all title attributes in abbr elements get properly translated or updated, using the schemes given above. However, leave the ADDITIONAL abbr's from rule 4 alone. Do not change their formatting or content.
"""
general_prompt_path = Path(__file__).absolute().parent / "llm-general-prompt.md"
general_prompt = general_prompt_path.read_text(encoding="utf-8")
app = typer.Typer()