Debian Codegraph @

scripts/general-llm-prompt.md

raw
1 ### Your task
2
3 Translate an English original content to a target language.
4
5 The original content is written in Markdown, write the translation in Markdown as well.
6
7 The original content will be surrounded by triple percentage signs (%%%). Do not include the triple percentage signs in the translation.
8
9 [placeholder_for_additional_instructions]
10
11 ### Technical terms in English
12
13 For technical terms in English that don't have a common translation term, use the original term in English.
14
15 ### Content of code snippets
16
17 Do not translate the content of code snippets, keep the original in English. For example, `list`, `dict`, keep them as is.
18
19 ### Content of code blocks
20
21 Do not translate the content of code blocks, except for comments in the language which the code block uses.
22
23 Examples:
24
25 Source (English) - The code block is a bash code example with one comment:
26
27 ```bash
28 # Print greeting
29 echo "Hello, World!"
30 ```
31
32 Result (German):
33
34 ```bash
35 # Gruß ausgeben
36 echo "Hello, World!"
37 ```
38
39 Source (English) - The code block is a console example containing HTML tags. No comments, so nothing to change here:
40
41 ```console
42 $ <font color="#4E9A06">fastapi</font> run <u style="text-decoration-style:solid">main.py</u>
43 <span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting server
44 Searching for package file structure
45 ```
46
47 Result (German):
48
49 ```console
50 $ <font color="#4E9A06">fastapi</font> run <u style="text-decoration-style:solid">main.py</u>
51 <span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting server
52 Searching for package file structure
53 ```
54
55 Source (English) - The code block is a console example containing 5 comments:
56
57
58 ```console
59 // Go to the home directory
60 $ cd
61 // Create a directory for all your code projects
62 $ mkdir code
63 // Enter into that code directory
64 $ cd code
65 // Create a directory for this project
66 $ mkdir awesome-project
67 // Enter into that project directory
68 $ cd awesome-project
69 ```
70
71 Result (German):
72
73 ```console
74 // Gehe zum Home-Verzeichnis
75 $ cd
76 // Erstelle ein Verzeichnis für alle Ihre Code-Projekte
77 $ mkdir code
78 // Gehe in dieses Code-Verzeichnis
79 $ cd code
80 // Erstelle ein Verzeichnis für dieses Projekt
81 $ mkdir awesome-project
82 // Gehe in dieses Projektverzeichnis
83 $ cd awesome-project
84 ```
85
86 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.
87
88 Example:
89
90 Source (English):
91
92 ```mermaid
93 flowchart LR
94 subgraph global[global env]
95 harry-1[harry v1]
96 end
97 subgraph stone-project[philosophers-stone project]
98 stone(philosophers-stone) -->|requires| harry-1
99 end
100 ```
101
102 Existing translation (German) - has three translations:
103
104 ```mermaid
105 flowchart LR
106 subgraph global[globale Umgebung]
107 harry-1[harry v1]
108 end
109 subgraph stone-project[philosophers-stone-Projekt]
110 stone(philosophers-stone) -->|benötigt| harry-1
111 end
112 ```
113
114 Result (German) - you change nothing:
115
116 ```mermaid
117 flowchart LR
118 subgraph global[globale Umgebung]
119 harry-1[harry v1]
120 end
121 subgraph stone-project[philosophers-stone-Projekt]
122 stone(philosophers-stone) -->|benötigt| harry-1
123 end
124 ```
125
126 ### Special blocks
127
128 There are special blocks of notes, tips and others that look like:
129
130 /// note
131 Here goes a note
132 ///
133
134 To translate it, keep the same line and add the translation after a vertical bar.
135
136 For example, if you were translating to Spanish, you would write:
137
138 /// note | Nota
139
140 Some examples in Spanish:
141
142 Source (English):
143
144 /// tip
145
146 Result (Spanish):
147
148 /// tip | Consejo
149
150 Source (English):
151
152 /// details | Preview
153
154 Result (Spanish):
155
156 /// details | Vista previa
157
158 ### Tab blocks
159
160 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:
161
162 //// tab | {tab title}
163 {tab content, may span many lines}
164 ////
165
166 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.
167
168 Examples:
169
170 Source (English):
171
172 //// tab | Python 3.8+ non-Annotated
173 Hello
174 ////
175
176 Result (German):
177
178 //// tab | Python 3.8+ nicht annotiert
179 Hallo
180 ////
181
182 Source (English) - Here there is nothing to translate in the tab title:
183
184 //// tab | Linux, macOS, Windows Bash
185 Hello again
186 ////
187
188 Result (German):
189
190 //// tab | Linux, macOS, Windows Bash
191 Hallo wieder
192 ////
193
194 ### Headings
195
196 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.
197
198 Examples of how to translate a heading:
199
200 Source (English):
201
202 ```
203 ## Alternative API docs { #alternative-api-docs }
204 ```
205
206 Result (Spanish):
207
208 ```
209 ## Documentación de la API alternativa { #alternative-api-docs }
210 ```
211
212 Source (English):
213
214 ```
215 ### Example { #example }
216 ```
217
218 Result (German):
219
220 ```
221 ### Beispiel { #example }
222 ```
223
224 ### Links
225
226 Use the following rules for links (apply both to Markdown-style links ([text](url)) and to HTML-style <a href="url">text</a> tags):
227
228 - The order of links should match the order of links in the English source. Do not change the order of links. Rephrase the sentence if necessary.
229
230 - For relative URLs, only translate the link text. Do not translate the URL or its parts.
231
232 Example:
233
234 Source (English):
235
236 ```
237 [One of the fastest Python frameworks available](#performance)
238 ```
239
240 Result (German):
241
242 ```
243 [Eines der schnellsten verfügbaren Python-Frameworks](#performance)
244 ```
245
246 - For absolute URLs which DO NOT start EXACTLY with https://fastapi.tiangolo.com, only translate the link text and leave the URL unchanged.
247
248 Example:
249
250 Source (English):
251
252 ```
253 <a href="https://sqlmodel.tiangolo.com/" class="external-link" target="_blank">SQLModel docs</a>
254 ```
255
256 Result (German):
257
258 ```
259 <a href="https://sqlmodel.tiangolo.com/" class="external-link" target="_blank">SQLModel-Dokumentation</a>
260 ```
261
262 - 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]).
263
264 Example:
265
266 Source (English):
267
268 ```
269 <a href="https://fastapi.tiangolo.com/tutorial/path-params/#documentation" class="external-link" target="_blank">Documentation</a>
270 ```
271
272 Result (Spanish):
273
274 ```
275 <a href="https://fastapi.tiangolo.com/es/tutorial/path-params/#documentation" class="external-link" target="_blank">Documentación</a>
276 ```
277
278 - Do not add language codes for URLs that point to static assets (e.g., images, CSS, JavaScript).
279
280 Example:
281
282 Source (English):
283
284 ```
285 <a href="https://fastapi.tiangolo.com/img/something.jpg" class="external-link" target="_blank">Something</a>
286 ```
287
288 Result (Spanish):
289
290 ```
291 <a href="https://fastapi.tiangolo.com/img/something.jpg" class="external-link" target="_blank">Algo</a>
292 ```
293
294 - For internal links, only translate link text.
295
296 Example:
297
298 Source (English):
299
300 ```
301 [Create Pull Requests](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}
302 ```
303
304 Result (German):
305
306 ```
307 [Pull Requests erzeugen](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}
308 ```
309
310 - Do not translate anchor fragments in links (the part after `#`), as they must remain the same to work correctly.
311
312 - 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.
313
314 Example:
315
316 Source (English):
317
318 ```
319 [Body - Multiple Parameters: Singular values in body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}
320 ```
321
322 Existing wrong translation (German) - notice the wrongly translated anchor fragment:
323
324 ```
325 [Body - Mehrere Parameter: Einfache Werte im Body](body-multiple-params.md#einzelne-werte-im-body){.internal-link target=_blank}.
326 ```
327
328 Result (German) - you fix the anchor fragment:
329
330 ```
331 [Body - Mehrere Parameter: Einfache Werte im Body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}.
332 ```
333
334 - Do not add anchor fragments at will, even if this makes sense. If the English source has no anchor, don't add one.
335
336 Example:
337
338 Source (English):
339
340 ```
341 Create a [virtual environment](../virtual-environments.md){.internal-link target=_blank}
342 ```
343
344 Wrong translation in German - Anchor added to the URL.
345
346 ```
347 Erstelle eine [virtuelle Umgebung](../virtual-environments.md#create-a-virtual-environment){.internal-link target=_blank}
348 ```
349
350 Good translation (German) - URL stays like in the English source.
351
352 ```
353 Erstelle eine [Virtuelle Umgebung](../virtual-environments.md){.internal-link target=_blank}
354 ```
355
356 **Important**: Always match the link syntax used in the English source document. If the English source uses Markdown-style links (`[text](url)`), the translation must also use Markdown-style links. If the English source uses HTML-style links (`<a href="url">text</a>`), the translation must also use HTML-style links. The link format in the translation must always mirror the link format in the English source.
357
358 ### HTML abbr elements
359
360 Translate HTML abbr elements (`<abbr title="description">text</abbr>`) as follows:
361
362 - The text inside abbr tag may be surrounded by further HTML or Markdown markup or quotes, for example <code>text</code> or `text` or "text". Preserve markup and only translate visible text inside the abbr element.
363
364 - 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.
365
366 Conversion scheme:
367
368 Source (English):
369
370 ```
371 <abbr title="{full phrase}">{abbreviation}</abbr>
372 ```
373
374 Result:
375
376 ```
377 <abbr title="{full phrase} - {translation of full phrase}">{abbreviation}</abbr>
378 ```
379
380 Examples:
381
382 Source (English):
383
384 ```
385 <abbr title="Internet of Things">IoT</abbr>
386 <abbr title="Central Processing Unit">CPU</abbr>
387 <abbr title="too long; didn't read"><strong>TL;DR:</strong></abbr>
388 ```
389
390 Result (German):
391
392 ```
393 <abbr title="Internet of Things - Internet der Dinge">IoT</abbr>
394 <abbr title="Central Processing Unit - Zentrale Verarbeitungseinheit">CPU</abbr>
395 <abbr title="too long; didn't read - zu lang; hab's nicht gelesen"><strong>TL;DR:</strong></abbr>
396 ```
397
398 - 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.
399
400 Conversion scheme:
401
402 Source (English):
403
404 ```
405 <abbr title="{full phrase}">{abbreviation}</abbr>
406 ```
407
408 Result:
409
410 ```
411 <abbr title="{translation of full phrase}">{abbreviation}</abbr>
412 ```
413
414 Examples:
415
416 Source (English):
417
418 ```
419 <abbr title="JSON Web Tokens">JWT</abbr>
420 <abbr title="Enumeration">Enum</abbr>
421 <abbr title="Asynchronous Server Gateway Interface">ASGI</abbr>
422 ```
423
424 Result (German):
425
426 ```
427 <abbr title="JSON Web Tokens">JWT</abbr>
428 <abbr title="Enumeration">Enum</abbr>
429 <abbr title="Asynchrones Server-Gateway-Interface">ASGI</abbr>
430 ```
431
432 - If the title of abbr element contains a 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.
433
434 Conversion scheme:
435
436 Source (English):
437
438 ```
439 <abbr title="{full phrase}: {other information}">{abbreviation}</abbr>
440 ```
441
442 Result:
443
444 ```
445 <abbr title="{full phrase} - {translation of full phrase}: {translation of other information}">{abbreviation}</abbr>
446 ```
447
448 Examples:
449
450 Source (English):
451
452 ```
453 <abbr title="Input/Output: disk reading or writing, network communication.">I/O</abbr>
454 <abbr title="Content Delivery Network: service, that provides static files.">CDN</abbr>
455 <abbr title="Integrated Development Environment: similar to a code editor">IDE</abbr>
456 ```
457
458 Result (German):
459
460 ```
461 <abbr title="Input/Output - Eingabe/Ausgabe: Lesen oder Schreiben auf der Festplatte, Netzwerkkommunikation.">I/O</abbr>
462 <abbr title="Content Delivery Network - Inhalte auslieferndes Netzwerk: Dienst, der statische Dateien bereitstellt.">CDN</abbr>
463 <abbr title="Integrated Development Environment - Integrierte Entwicklungsumgebung: Ähnlich einem Code-Editor">IDE</abbr>
464 ```
465
466 - 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.
467
468 Conversion scheme:
469
470 Source (English):
471
472 ```
473 <abbr title="{full phrase}: {information}">{abbreviation}</abbr>
474 ```
475
476 Result:
477
478 ```
479 <abbr title="{translation of full phrase}: {translation of information}">{abbreviation}</abbr>
480 ```
481
482 Example:
483
484 Source (English):
485
486 ```
487 <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>
488 ```
489
490 Result (German):
491
492 ```
493 <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>
494 ```
495
496 - 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.
497
498 - 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.
499
500 ### HTML dfn elements
501
502 For HTML dfn elements (`<dfn>text</dfn>`), translate the text inside the dfn element and the title attribute. Do not include the original English text in the title attribute.
503
504 Examples:
505
506 Source (English):
507
508 ```
509 <dfn title="also known as: endpoints, routes">path</dfn>
510 <dfn title="a program that checks for code errors">linter</dfn>
511 ```
512
513 Result (German):
514
515 ```
516 <dfn title="auch bekannt als: Endpunkte, Routen">Pfad</dfn>
517 <dfn title="Programm das auf Fehler im Code prüft">Linter</dfn>
518 ```