airflow-translations
Add or update translations for the Apache Airflow UI. Guides through setting up locales, scaffolding translation files, translating with locale-specific guidelines, and validating results. Use when working with i18n tasks in airflow-core/src/airflow/ui/public/i18n/locales/.
Оригинален текст · няма потвърден превод на българскиПърво прочетете инструкцията.
Файлът се зарежда от посочения източник само по ваше действие. Можете да го прочетете тук, да го копирате или да го запазите като .md.
GitHub хранилище- Звезди на репото
- 45 779
- Лиценз
- Не е посочен. Проверете в репозитория.
- Последна проверка на записа
- Няма посочена дата
Добавете в своя инструмент.
Командата отваря избора на skills от репозитория. Прочетете файла и условията на автора преди изпълнение.
npx skills add apache/airflowСтраницата копира текст. Не инсталира и не изпълнява нищо на устройството ви.
Откъс от SKILL.md
Началото на файла на автора, без превод.
Airflow Translations
Determining the Task
Translation work falls into one of two categories depending on whether the
target locale already exists. Check if a directory for the locale exists under
airflow-core/src/airflow/ui/public/i18n/locales/<locale>/. If it does, skip
ahead to Updating an Existing Translation. If not, start with Adding a Translation below.
Adding a Translation
When adding a translation, some configuration files need to be updated before translation work can begin.
Setting up the locale
First, create the locale directory:
mkdir -p airflow-core/src/airflow/ui/public/i18n/locales/<locale>/
Then update the following configuration files, keeping the existing alphabetical ordering in each file:
airflow-core/src/airflow/ui/src/i18n/config.ts: add the locale to the
supportedLanguages array:
{ code: "<locale>", name: "<native name>" },
dev/breeze/src/airflow_breeze/commands/ui_commands.py: add the plural
suffixes for the language to the PLURAL_SUFFIXES dict. Check the i18next
plural rules for the language at https://jsfiddle.net/6bpxsgd4 to determine
which suffixes are needed:
"<locale>": ["<suffixes>"],
.github/boring-cyborg.yml: under labelPRBasedOnFilePath, add:
translation:<locale>:
- airflow-core/src/airflow/ui/public/i18n/locales/<locale>/*
Scaffolding the translation files
Once the configuration is in place, run the breeze command to copy every
English namespace file into the new locale directory. This populates each key
with a TODO: translate: stub:
breeze ui check-translation-completeness --language <locale> --add-missing
The generated files will look like this:
{
"allRuns": "TODO: translate: All Runs",
"blockingDeps": {
"dependency": "TODO: translate: Dependency",
"reason": "TODO: translate: Reason"
}
}
Translating
With the scaffolded files in place, read the locale-specific guideline for the target language (see the table under Locale-Specific Guidelines below). If one exists, it contains the glossary, tone rules, and formatting conventions that must be followed. If no locale-specific guideline exists yet, follow the translation rules described later in this document.