From 2b6fee87d42ef87ec830aa40bd89bdb4685ebd75 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Fri, 1 Aug 2025 12:35:02 +0200 Subject: [PATCH] Add examples of handling code blocks to avoid translating them --- scripts/translate.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/scripts/translate.py b/scripts/translate.py index 2fdc18ca0..268d9e0d6 100644 --- a/scripts/translate.py +++ b/scripts/translate.py @@ -34,6 +34,36 @@ The content is written in markdown, write the translation in markdown as well. D When there's an example of code, the console or a terminal, normally surrounded by triple backticks and a keyword like "console" or "bash" (e.g. ```console), do not translate the content, keep the original in English. +For example, if the original (English) content is: + +```bash +# Print greeting +echo "Hello, World!" +``` + +It should be exacly the same in the output document: + +```bash +# Print greeting +echo "Hello, World!" +``` + +If the original (English) content is: + +```console +$ fastapi run main.py + FastAPI Starting server + Searching for package file structure +``` + +It should be exacly the same in the output document: + +```console +$ fastapi run main.py + FastAPI Starting server + Searching for package file structure +``` + The original content will be surrounded by triple percentage signs (%) and you should translate it to the target language. Do not include the triple percentage signs in the translation. There are special blocks of notes, tips and others that look like: