From 69445a8789e7f3b4dc192a3d91241b94d2aa7fb9 Mon Sep 17 00:00:00 2001 From: whereareiam Date: Sat, 14 Nov 2026 15:24:14 +0100 Subject: [PATCH] feat(templates): add GitHub's wording as an optional translated add-on Forgejo reads a custom locale file instead of its own, never on top of it, so the theme could not add GitHub's wording without replacing Forgejo's translations and any an admin customised. The theme now keeps its own phrases in locales/.json for every language Forgejo enables by default, and the build compiles them with Forgejo's plural rules into the template theme/phrase. A template asks for a phrase with Forgejo's text as the fallback. The wording is optional. The templates pack's theme/phrase prints only Forgejo's text, so the pack keeps Forgejo's translations. The compiled template ships alone in theme-github-wording.tar.gz, which admins extract over the pack for GitHub's wording; a reader in a language without theme phrases still sees Forgejo's. The local preview applies it unless FORGEJO_PREVIEW_GITHUB_WORDING=false. The first phrases are the merge box's: check titles, counts and groups, the clean, conflict and draft rows, and the merged and closed boxes. A test keeps every language complete, with its plural forms and the English placeholders. Co-Authored-By: Claude Opus 5.5 --- .../actions/build-release-assets/package.sh | 3 + ARCHITECTURE.md | 21 ++ README.md | 5 +- dev/preview/auth/AutoLoginTemplate.ts | 5 +- dev/preview/config/PreviewConfig.ts | 6 +- dev/preview/config/constants.ts | 7 + locales/bg.json | 41 +++ locales/cs-CZ.json | 46 ++++ locales/da.json | 41 +++ locales/de-DE.json | 41 +++ locales/el-GR.json | 41 +++ locales/en-US.json | 26 ++ locales/eo.json | 41 +++ locales/es-ES.json | 41 +++ locales/fa-IR.json | 41 +++ locales/fi-FI.json | 41 +++ locales/fil.json | 41 +++ locales/fr-FR.json | 41 +++ locales/hu-HU.json | 41 +++ locales/id-ID.json | 36 +++ locales/it-IT.json | 41 +++ locales/ja-JP.json | 36 +++ locales/ko-KR.json | 36 +++ locales/lv-LV.json | 46 ++++ locales/nds.json | 41 +++ locales/nl-NL.json | 41 +++ locales/pl-PL.json | 46 ++++ locales/pt-BR.json | 41 +++ locales/pt-PT.json | 41 +++ locales/ru-RU.json | 46 ++++ locales/sl.json | 51 ++++ locales/sv-SE.json | 41 +++ locales/tr-TR.json | 41 +++ locales/uk-UA.json | 46 ++++ locales/zh-CN.json | 36 +++ locales/zh-HK.json | 36 +++ locales/zh-TW.json | 36 +++ scripts/assembleForgejo.ts | 11 + scripts/phrases.test.ts | 82 ++++++ scripts/phrases.ts | 233 ++++++++++++++++++ 40 files changed, 1631 insertions(+), 3 deletions(-) create mode 100644 locales/bg.json create mode 100644 locales/cs-CZ.json create mode 100644 locales/da.json create mode 100644 locales/de-DE.json create mode 100644 locales/el-GR.json create mode 100644 locales/en-US.json create mode 100644 locales/eo.json create mode 100644 locales/es-ES.json create mode 100644 locales/fa-IR.json create mode 100644 locales/fi-FI.json create mode 100644 locales/fil.json create mode 100644 locales/fr-FR.json create mode 100644 locales/hu-HU.json create mode 100644 locales/id-ID.json create mode 100644 locales/it-IT.json create mode 100644 locales/ja-JP.json create mode 100644 locales/ko-KR.json create mode 100644 locales/lv-LV.json create mode 100644 locales/nds.json create mode 100644 locales/nl-NL.json create mode 100644 locales/pl-PL.json create mode 100644 locales/pt-BR.json create mode 100644 locales/pt-PT.json create mode 100644 locales/ru-RU.json create mode 100644 locales/sl.json create mode 100644 locales/sv-SE.json create mode 100644 locales/tr-TR.json create mode 100644 locales/uk-UA.json create mode 100644 locales/zh-CN.json create mode 100644 locales/zh-HK.json create mode 100644 locales/zh-TW.json create mode 100644 scripts/phrases.test.ts create mode 100644 scripts/phrases.ts diff --git a/.github/actions/build-release-assets/package.sh b/.github/actions/build-release-assets/package.sh index 5bdd72ce..7184e356 100644 --- a/.github/actions/build-release-assets/package.sh +++ b/.github/actions/build-release-assets/package.sh @@ -36,3 +36,6 @@ while IFS= read -r stylesheet; do cp "$stylesheet" "$target/" done < <(find dist/forgejo/public/assets/css -type f -name "*.css" ! -name "theme-*") tar -zcf dist/theme-github-templates.tar.gz -C "$template_stage" templates public + +# The optional GitHub wording replaces one template of the pack, so it extracts over it. +tar -zcf dist/theme-github-wording.tar.gz -C dist/github-wording templates diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 535e95b6..263f51af 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -34,6 +34,7 @@ theme.config.ts, themes/, primer/, styles/*.ts templates/, components/, sty | `src/` | The generator: palettes, CSS variables, Vite plugin | nothing; it runs at build time | `vite.config.ts` | | `styles/` (`*.ts`) | Theme-wide overrides of Forgejo's markup | every theme stylesheet | the theme stylesheet | | `templates/` | Overrides of Forgejo templates, at Forgejo's paths | `dist/forgejo/templates` | Forgejo, in place of its own template | +| `locales/.json` | The theme's own phrases, one file per language | `dist/github-wording/templates/theme/phrase.tmpl` | `{{template "theme/phrase" ...}}` | | `components///` | Reusable UI: template, stylesheet, script and tests | `templates/components/`, `css/components/`, `js/components/` | `templates/base/component_assets.tmpl` | | `styles/pages/*.css` | Layout of one page or a family of pages | `css/components/pages/` | `templates/base/component_assets.tmpl` | | `public/*.css`, `public/assets/js/*` | Stylesheets and scripts that a template links itself | `css/`, `js/` | the template that needs it | @@ -170,6 +171,26 @@ server-rendered markup that works without them: `components/repository/results/r the same GET route's response, and the form still submits without it. Script tests load the script into a `node:vm` context with a stubbed document. +### Theme phrases + +Some of GitHub's wording has no Forgejo translation, such as "1 failing check" in the merge box. Forgejo reads a custom +locale file instead of its own one, never on top of it, so adding keys to Forgejo's translations would replace them and +any an admin customised. The theme keeps its phrases apart instead: `locales/.json` holds them for each language +Forgejo enables by default, and the assembly compiles them, with Forgejo's plural rule for each language, into the +template `theme/phrase` (`scripts/phrases.ts`). GitHub's wording is optional: the templates pack's `theme/phrase` prints +only Forgejo's text, and the compiled one ships alone in `theme-github-wording.tar.gz` (`dist/github-wording`), which +admins extract over the pack. The local preview applies it unless `FORGEJO_PREVIEW_GITHUB_WORDING=false`. A template +asks for a phrase with Forgejo's own text as the fallback: + +```gotemplate +{{template "theme/phrase" dict "Key" "pulls.checks.group_failing" "Count" 2 "Fallback" (ctx.Locale.Tr "repo.pulls.status_checks_failure")}} +``` + +Without the add-on, and with it for a reader whose language has no theme phrases, the fallback shows, so no English +shows up in another language. A phrase is a string or one string per plural form; `{count}` and `{branch}` take the +dict's `Count` and `Branch`. A test checks that every language has every English key, the plural forms its rule needs +and the same placeholders. + ### Asset versions Forgejo serves custom assets with a long cache lifetime and versions the theme stylesheet link with its own release diff --git a/README.md b/README.md index c05c6579..dc6647fd 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,10 @@ Install the resulting files using your Forgejo data directory (commonly `data/gi `theme-github-extras.tar.gz` for Pink, Gitea-compatible, and Catppuccin themes. Place their CSS files in the same `/public/assets/css` directory. 3. Extract the optional `theme-github-templates.tar.gz` archive into ``. It includes the templates and - their required JavaScript and page-specific CSS assets under `public/assets`. + their required JavaScript and page-specific CSS assets under `public/assets`. Its text is Forgejo's translations. For + GitHub's wording where Forgejo has none, such as "1 failing check" in a pull request's merge box, also extract the + optional `theme-github-wording.tar.gz` into `` afterwards, in every language Forgejo enables by + default. It replaces one file of the templates, so extract it again after every templates update. 4. Modify `/conf/app.ini` and append the CSS filename without the `theme-` prefix to `THEMES` under the `[ui]` section. 5. Restart Forgejo. diff --git a/dev/preview/auth/AutoLoginTemplate.ts b/dev/preview/auth/AutoLoginTemplate.ts index 25e69d5a..b36f0786 100644 --- a/dev/preview/auth/AutoLoginTemplate.ts +++ b/dev/preview/auth/AutoLoginTemplate.ts @@ -1,4 +1,4 @@ -import { cpSync, mkdirSync, rmSync, writeFileSync } from "node:fs"; +import { cpSync, existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs"; import { dirname } from "node:path"; import { AUTO_LOGIN } from "../config/constants.ts"; @@ -14,6 +14,9 @@ export class AutoLoginTemplate { public prepare(): void { rmSync(this.config.generatedTemplatesDirectory, { force: true, recursive: true }); cpSync(this.config.themeTemplatesDirectory, this.config.generatedTemplatesDirectory, { recursive: true }); + // Like an admin who installs the optional add-on, extracted over the templates pack. + if (this.config.githubWordingEnabled && existsSync(this.config.githubWordingTemplatesDirectory)) + cpSync(this.config.githubWordingTemplatesDirectory, this.config.generatedTemplatesDirectory, { recursive: true }); if (!this.config.autoLoginEnabled) return; mkdirSync(dirname(this.config.autoLoginTemplateFile), { recursive: true }); diff --git a/dev/preview/config/PreviewConfig.ts b/dev/preview/config/PreviewConfig.ts index daeca36f..51bd47df 100644 --- a/dev/preview/config/PreviewConfig.ts +++ b/dev/preview/config/PreviewConfig.ts @@ -1,6 +1,6 @@ import { join, resolve } from "node:path"; -import { AUTO_LOGIN, COMPOSE, ENVIRONMENT, FIXTURES, PREVIEW, SOURCE_PATHS } from "./constants.ts"; +import { AUTO_LOGIN, COMPOSE, ENVIRONMENT, FIXTURES, GITHUB_WORDING, PREVIEW, SOURCE_PATHS } from "./constants.ts"; export class PreviewConfig { public readonly projectDirectory: string; @@ -14,6 +14,8 @@ export class PreviewConfig { public readonly previewEmail: string; public readonly autoLoginEnabled: boolean; public readonly themeTemplatesDirectory: string; + public readonly githubWordingTemplatesDirectory: string; + public readonly githubWordingEnabled: boolean; public readonly generatedTemplatesDirectory: string; public readonly autoLoginTemplateFile: string; public readonly themeAssetsDirectory: string; @@ -36,6 +38,8 @@ export class PreviewConfig { this.previewEmail = environment[ENVIRONMENT.email] ?? PREVIEW.defaultEmail; this.autoLoginEnabled = environment[AUTO_LOGIN.environment] !== AUTO_LOGIN.disabledValue; this.themeTemplatesDirectory = join(this.projectDirectory, "dist/forgejo/templates"); + this.githubWordingTemplatesDirectory = join(this.projectDirectory, "dist/github-wording/templates"); + this.githubWordingEnabled = environment[GITHUB_WORDING.environment] !== GITHUB_WORDING.disabledValue; this.generatedTemplatesDirectory = join(this.projectDirectory, "dev/.generated/templates"); this.autoLoginTemplateFile = join(this.projectDirectory, AUTO_LOGIN.templateDirectory, AUTO_LOGIN.templateFile); this.themeAssetsDirectory = join(this.projectDirectory, "dist/forgejo/public/assets"); diff --git a/dev/preview/config/constants.ts b/dev/preview/config/constants.ts index da3fde5f..5f986ed0 100644 --- a/dev/preview/config/constants.ts +++ b/dev/preview/config/constants.ts @@ -37,6 +37,12 @@ export const AUTO_LOGIN = { loginPath: "/user/login", } as const; +/** The preview applies the GitHub wording add-on unless this is "false". */ +export const GITHUB_WORDING = { + environment: "FORGEJO_PREVIEW_GITHUB_WORDING", + disabledValue: "false", +} as const; + export const CONTAINER_PATHS = { css: "/var/lib/gitea/custom/public/assets/css", templates: "/var/lib/gitea/custom/templates", @@ -54,6 +60,7 @@ export const SOURCE_PATHS = [ "templates", "themes", "primer", + "locales", ] as const; export const ENVIRONMENT = { diff --git a/locales/bg.json b/locales/bg.json new file mode 100644 index 00000000..6bd8a955 --- /dev/null +++ b/locales/bg.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Всички проверки са успешни", + "pulls.checks.title_pending": "Някои проверки още не са завършили", + "pulls.checks.title_failure": "Някои проверки не бяха успешни", + "pulls.checks.title_conflict": "Проверките чакат разрешаване на конфликтите", + "pulls.checks.count_failing": "{count} неуспешни", + "pulls.checks.count_pending": "{count} в очакване", + "pulls.checks.count_skipped": "{count} пропуснати", + "pulls.checks.count_successful": "{count} успешни", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} неуспешна проверка", + "other": "{count} неуспешни проверки" + }, + "pulls.checks.group_pending": { + "one": "{count} проверка в очакване", + "other": "{count} проверки в очакване" + }, + "pulls.checks.group_skipped": { + "one": "{count} пропусната проверка", + "other": "{count} пропуснати проверки" + }, + "pulls.checks.group_successful": { + "one": "{count} успешна проверка", + "other": "{count} успешни проверки" + }, + "pulls.merge.clean_title": "Няма конфликти с основния клон", + "pulls.merge.clean_description": "Сливането може да се извърши автоматично.", + "pulls.merge.conflict_title": "Този клон има конфликти, които трябва да бъдат разрешени", + "pulls.merge.conflict_description": "Разрешете конфликтите от командния ред, преди да продължите.", + "pulls.merge.draft_title": "Тази заявка за сливане все още е в процес на работа", + "pulls.merge.draft_description": "Заявки за сливане в процес на работа не могат да бъдат слети.", + "pulls.merge.command_line_hint": "Можете също да слеете това от командния ред.", + "pulls.merged.description": "Всичко е готово — клонът {branch} може безопасно да бъде изтрит.", + "pulls.closed.title": "Затворена с неслети подавания", + "pulls.closed.description": "Тази заявка за сливане е затворена, но клонът {branch} има неслети подавания." +} diff --git a/locales/cs-CZ.json b/locales/cs-CZ.json new file mode 100644 index 00000000..d0d021cf --- /dev/null +++ b/locales/cs-CZ.json @@ -0,0 +1,46 @@ +{ + "pulls.checks.title_success": "Všechny kontroly prošly", + "pulls.checks.title_pending": "Některé kontroly ještě neskončily", + "pulls.checks.title_failure": "Některé kontroly nebyly úspěšné", + "pulls.checks.title_conflict": "Kontroly čekají na vyřešení konfliktů", + "pulls.checks.count_failing": "neúspěšné: {count}", + "pulls.checks.count_pending": "čekající: {count}", + "pulls.checks.count_skipped": "přeskočené: {count}", + "pulls.checks.count_successful": "úspěšné: {count}", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "few": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} neúspěšná kontrola", + "few": "{count} neúspěšné kontroly", + "other": "{count} neúspěšných kontrol" + }, + "pulls.checks.group_pending": { + "one": "{count} čekající kontrola", + "few": "{count} čekající kontroly", + "other": "{count} čekajících kontrol" + }, + "pulls.checks.group_skipped": { + "one": "{count} přeskočená kontrola", + "few": "{count} přeskočené kontroly", + "other": "{count} přeskočených kontrol" + }, + "pulls.checks.group_successful": { + "one": "{count} úspěšná kontrola", + "few": "{count} úspěšné kontroly", + "other": "{count} úspěšných kontrol" + }, + "pulls.merge.clean_title": "Žádné konflikty se základní větví", + "pulls.merge.clean_description": "Sloučení lze provést automaticky.", + "pulls.merge.conflict_title": "Tato větev má konflikty, které je třeba vyřešit", + "pulls.merge.conflict_description": "Než budete pokračovat, vyřešte konflikty v příkazové řádce.", + "pulls.merge.draft_title": "Tato žádost o sloučení je stále rozpracovaná", + "pulls.merge.draft_description": "Rozpracované žádosti o sloučení nelze sloučit.", + "pulls.merge.command_line_hint": "Můžete ji také sloučit z příkazové řádky.", + "pulls.merged.description": "Vše je hotovo — větev {branch} lze bezpečně smazat.", + "pulls.closed.title": "Uzavřeno s nesloučenými revizemi", + "pulls.closed.description": "Tato žádost o sloučení je uzavřena, ale větev {branch} obsahuje nesloučené revize." +} diff --git a/locales/da.json b/locales/da.json new file mode 100644 index 00000000..63edf4ed --- /dev/null +++ b/locales/da.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Alle kontroller er bestået", + "pulls.checks.title_pending": "Nogle kontroller er ikke færdige endnu", + "pulls.checks.title_failure": "Nogle kontroller lykkedes ikke", + "pulls.checks.title_conflict": "Kontroller afventer løsning af konflikter", + "pulls.checks.count_failing": "{count} mislykket", + "pulls.checks.count_pending": "{count} afventer", + "pulls.checks.count_skipped": "{count} sprunget over", + "pulls.checks.count_successful": "{count} lykkedes", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} mislykket kontrol", + "other": "{count} mislykkede kontroller" + }, + "pulls.checks.group_pending": { + "one": "{count} afventende kontrol", + "other": "{count} afventende kontroller" + }, + "pulls.checks.group_skipped": { + "one": "{count} oversprunget kontrol", + "other": "{count} oversprungne kontroller" + }, + "pulls.checks.group_successful": { + "one": "{count} vellykket kontrol", + "other": "{count} vellykkede kontroller" + }, + "pulls.merge.clean_title": "Ingen konflikter med basisgrenen", + "pulls.merge.clean_description": "Fletning kan udføres automatisk.", + "pulls.merge.conflict_title": "Denne gren har konflikter, der skal løses", + "pulls.merge.conflict_description": "Løs konflikterne via kommandolinjen, før du fortsætter.", + "pulls.merge.draft_title": "Denne pull-anmodning er stadig et igangværende arbejde", + "pulls.merge.draft_description": "Igangværende pull-anmodninger kan ikke flettes.", + "pulls.merge.command_line_hint": "Du kan også flette dette via kommandolinjen.", + "pulls.merged.description": "Alt er klar – grenen {branch} kan trygt slettes.", + "pulls.closed.title": "Lukket med ikke-flettede commits", + "pulls.closed.description": "Denne pull-anmodning er lukket, men grenen {branch} har commits, der ikke er flettet." +} diff --git a/locales/de-DE.json b/locales/de-DE.json new file mode 100644 index 00000000..41607e71 --- /dev/null +++ b/locales/de-DE.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Alle Prüfungen waren erfolgreich", + "pulls.checks.title_pending": "Einige Prüfungen sind noch nicht abgeschlossen", + "pulls.checks.title_failure": "Einige Prüfungen waren nicht erfolgreich", + "pulls.checks.title_conflict": "Prüfungen warten auf die Lösung der Konflikte", + "pulls.checks.count_failing": "{count} fehlgeschlagen", + "pulls.checks.count_pending": "{count} ausstehend", + "pulls.checks.count_skipped": "{count} übersprungen", + "pulls.checks.count_successful": "{count} erfolgreich", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} fehlgeschlagene Prüfung", + "other": "{count} fehlgeschlagene Prüfungen" + }, + "pulls.checks.group_pending": { + "one": "{count} ausstehende Prüfung", + "other": "{count} ausstehende Prüfungen" + }, + "pulls.checks.group_skipped": { + "one": "{count} übersprungene Prüfung", + "other": "{count} übersprungene Prüfungen" + }, + "pulls.checks.group_successful": { + "one": "{count} erfolgreiche Prüfung", + "other": "{count} erfolgreiche Prüfungen" + }, + "pulls.merge.clean_title": "Keine Konflikte mit dem Basis-Branch", + "pulls.merge.clean_description": "Das Zusammenführen kann automatisch erfolgen.", + "pulls.merge.conflict_title": "Dieser Branch hat Konflikte, die gelöst werden müssen", + "pulls.merge.conflict_description": "Die Konflikte vor dem Fortfahren über die Kommandozeile lösen.", + "pulls.merge.draft_title": "Dieser Pull-Request ist noch in Bearbeitung", + "pulls.merge.draft_description": "Pull-Requests in Bearbeitung können nicht zusammengeführt werden.", + "pulls.merge.command_line_hint": "Dies kann auch über die Kommandozeile zusammengeführt werden.", + "pulls.merged.description": "Alles erledigt – der Branch {branch} kann jetzt bedenkenlos gelöscht werden.", + "pulls.closed.title": "Geschlossen mit nicht zusammengeführten Commits", + "pulls.closed.description": "Dieser Pull-Request ist geschlossen, aber der Branch {branch} hat nicht zusammengeführte Commits." +} diff --git a/locales/el-GR.json b/locales/el-GR.json new file mode 100644 index 00000000..cade3e77 --- /dev/null +++ b/locales/el-GR.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Όλοι οι έλεγχοι πέρασαν", + "pulls.checks.title_pending": "Κάποιοι έλεγχοι δεν έχουν ολοκληρωθεί ακόμη", + "pulls.checks.title_failure": "Κάποιοι έλεγχοι δεν ήταν επιτυχείς", + "pulls.checks.title_conflict": "Οι έλεγχοι περιμένουν την επίλυση των συγκρούσεων", + "pulls.checks.count_failing": "{count} απέτυχαν", + "pulls.checks.count_pending": "{count} σε εκκρεμότητα", + "pulls.checks.count_skipped": "{count} παραλείφθηκαν", + "pulls.checks.count_successful": "{count} επιτυχείς", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} αποτυχημένος έλεγχος", + "other": "{count} αποτυχημένοι έλεγχοι" + }, + "pulls.checks.group_pending": { + "one": "{count} έλεγχος σε εκκρεμότητα", + "other": "{count} έλεγχοι σε εκκρεμότητα" + }, + "pulls.checks.group_skipped": { + "one": "{count} έλεγχος που παραλείφθηκε", + "other": "{count} έλεγχοι που παραλείφθηκαν" + }, + "pulls.checks.group_successful": { + "one": "{count} επιτυχής έλεγχος", + "other": "{count} επιτυχείς έλεγχοι" + }, + "pulls.merge.clean_title": "Καμία σύγκρουση με τον βασικό κλάδο", + "pulls.merge.clean_description": "Η συγχώνευση μπορεί να γίνει αυτόματα.", + "pulls.merge.conflict_title": "Αυτός ο κλάδος έχει συγκρούσεις που πρέπει να επιλυθούν", + "pulls.merge.conflict_description": "Επιλύστε τις συγκρούσεις από τη γραμμή εντολών πριν συνεχίσετε.", + "pulls.merge.draft_title": "Αυτό το pull request είναι ακόμη εργασία σε εξέλιξη", + "pulls.merge.draft_description": "Τα pull request σε εξέλιξη δεν μπορούν να συγχωνευθούν.", + "pulls.merge.command_line_hint": "Μπορείτε επίσης να το συγχωνεύσετε από τη γραμμή εντολών.", + "pulls.merged.description": "Όλα έτοιμα — ο κλάδος {branch} μπορεί να διαγραφεί με ασφάλεια.", + "pulls.closed.title": "Κλειστό με μη συγχωνευμένες υποβολές", + "pulls.closed.description": "Αυτό το pull request έχει κλείσει, αλλά ο κλάδος {branch} έχει μη συγχωνευμένες υποβολές." +} diff --git a/locales/en-US.json b/locales/en-US.json new file mode 100644 index 00000000..2aae16f4 --- /dev/null +++ b/locales/en-US.json @@ -0,0 +1,26 @@ +{ + "pulls.checks.title_success": "All checks have passed", + "pulls.checks.title_pending": "Some checks haven't completed yet", + "pulls.checks.title_failure": "Some checks were not successful", + "pulls.checks.title_conflict": "Checks awaiting conflict resolution", + "pulls.checks.count_failing": "{count} failing", + "pulls.checks.count_pending": "{count} pending", + "pulls.checks.count_skipped": "{count} skipped", + "pulls.checks.count_successful": "{count} successful", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { "one": "{list} check", "other": "{list} checks" }, + "pulls.checks.group_failing": { "one": "{count} failing check", "other": "{count} failing checks" }, + "pulls.checks.group_pending": { "one": "{count} pending check", "other": "{count} pending checks" }, + "pulls.checks.group_skipped": { "one": "{count} skipped check", "other": "{count} skipped checks" }, + "pulls.checks.group_successful": { "one": "{count} successful check", "other": "{count} successful checks" }, + "pulls.merge.clean_title": "No conflicts with base branch", + "pulls.merge.clean_description": "Merging can be performed automatically.", + "pulls.merge.conflict_title": "This branch has conflicts that must be resolved", + "pulls.merge.conflict_description": "Use the command line to resolve conflicts before continuing.", + "pulls.merge.draft_title": "This pull request is still a work in progress", + "pulls.merge.draft_description": "Draft pull requests cannot be merged.", + "pulls.merge.command_line_hint": "You can also merge this with the command line.", + "pulls.merged.description": "You're all set — the {branch} branch can be safely deleted.", + "pulls.closed.title": "Closed with unmerged commits", + "pulls.closed.description": "This pull request is closed, but the {branch} branch has unmerged commits." +} diff --git a/locales/eo.json b/locales/eo.json new file mode 100644 index 00000000..635081e4 --- /dev/null +++ b/locales/eo.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Ĉiuj kontroloj sukcesis", + "pulls.checks.title_pending": "Kelkaj kontroloj ankoraŭ ne finiĝis", + "pulls.checks.title_failure": "Kelkaj kontroloj ne sukcesis", + "pulls.checks.title_conflict": "Kontroloj atendas solvon de la konfliktoj", + "pulls.checks.count_failing": "{count} malsukcesaj", + "pulls.checks.count_pending": "{count} atendantaj", + "pulls.checks.count_skipped": "{count} preterlasitaj", + "pulls.checks.count_successful": "{count} sukcesaj", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} malsukcesa kontrolo", + "other": "{count} malsukcesaj kontroloj" + }, + "pulls.checks.group_pending": { + "one": "{count} atendanta kontrolo", + "other": "{count} atendantaj kontroloj" + }, + "pulls.checks.group_skipped": { + "one": "{count} preterlasita kontrolo", + "other": "{count} preterlasitaj kontroloj" + }, + "pulls.checks.group_successful": { + "one": "{count} sukcesa kontrolo", + "other": "{count} sukcesaj kontroloj" + }, + "pulls.merge.clean_title": "Neniuj konfliktoj kun la baza branĉo", + "pulls.merge.clean_description": "La kunfando povas esti farita aŭtomate.", + "pulls.merge.conflict_title": "Ĉi tiu branĉo havas konfliktojn, kiujn oni devas solvi", + "pulls.merge.conflict_description": "Solvu la konfliktojn per la komandlinio antaŭ ol daŭrigi.", + "pulls.merge.draft_title": "Ĉi tiu tirpeto ankoraŭ estas prilaborata", + "pulls.merge.draft_description": "Prilaborataj tirpetoj ne povas esti kunfanditaj.", + "pulls.merge.command_line_hint": "Vi ankaŭ povas kunfandi ĉi tion per la komandlinio.", + "pulls.merged.description": "Ĉio pretas — la branĉo {branch} povas esti sekure forigita.", + "pulls.closed.title": "Fermita kun nekunfanditaj enmetoj", + "pulls.closed.description": "Ĉi tiu tirpeto estas fermita, sed la branĉo {branch} havas nekunfanditajn enmetojn." +} diff --git a/locales/es-ES.json b/locales/es-ES.json new file mode 100644 index 00000000..8cd74ce8 --- /dev/null +++ b/locales/es-ES.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Todas las comprobaciones se han superado", + "pulls.checks.title_pending": "Algunas comprobaciones aún no han terminado", + "pulls.checks.title_failure": "Algunas comprobaciones no han tenido éxito", + "pulls.checks.title_conflict": "Comprobaciones a la espera de resolver los conflictos", + "pulls.checks.count_failing": "{count} fallidas", + "pulls.checks.count_pending": "{count} pendientes", + "pulls.checks.count_skipped": "{count} omitidas", + "pulls.checks.count_successful": "{count} correctas", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} comprobación fallida", + "other": "{count} comprobaciones fallidas" + }, + "pulls.checks.group_pending": { + "one": "{count} comprobación pendiente", + "other": "{count} comprobaciones pendientes" + }, + "pulls.checks.group_skipped": { + "one": "{count} comprobación omitida", + "other": "{count} comprobaciones omitidas" + }, + "pulls.checks.group_successful": { + "one": "{count} comprobación correcta", + "other": "{count} comprobaciones correctas" + }, + "pulls.merge.clean_title": "No hay conflictos con la rama base", + "pulls.merge.clean_description": "La fusión puede realizarse automáticamente.", + "pulls.merge.conflict_title": "Esta rama tiene conflictos que deben resolverse", + "pulls.merge.conflict_description": "Resuelve los conflictos desde la línea de comandos antes de continuar.", + "pulls.merge.draft_title": "Este pull request sigue siendo un trabajo en curso", + "pulls.merge.draft_description": "Los pull requests en curso no se pueden fusionar.", + "pulls.merge.command_line_hint": "También puedes fusionarlo desde la línea de comandos.", + "pulls.merged.description": "Todo listo: la rama {branch} se puede eliminar sin problema.", + "pulls.closed.title": "Cerrado con commits sin fusionar", + "pulls.closed.description": "Este pull request está cerrado, pero la rama {branch} tiene commits sin fusionar." +} diff --git a/locales/fa-IR.json b/locales/fa-IR.json new file mode 100644 index 00000000..47f9b55c --- /dev/null +++ b/locales/fa-IR.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "همه بررسی‌ها موفق بودند", + "pulls.checks.title_pending": "برخی بررسی‌ها هنوز تمام نشده‌اند", + "pulls.checks.title_failure": "برخی بررسی‌ها موفق نبودند", + "pulls.checks.title_conflict": "بررسی‌ها در انتظار حل تداخل‌ها هستند", + "pulls.checks.count_failing": "{count} ناموفق", + "pulls.checks.count_pending": "{count} در انتظار", + "pulls.checks.count_skipped": "{count} نادیده گرفته‌شده", + "pulls.checks.count_successful": "{count} موفق", + "pulls.checks.list_separator": "، ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} بررسی ناموفق", + "other": "{count} بررسی ناموفق" + }, + "pulls.checks.group_pending": { + "one": "{count} بررسی در انتظار", + "other": "{count} بررسی در انتظار" + }, + "pulls.checks.group_skipped": { + "one": "{count} بررسی نادیده گرفته‌شده", + "other": "{count} بررسی نادیده گرفته‌شده" + }, + "pulls.checks.group_successful": { + "one": "{count} بررسی موفق", + "other": "{count} بررسی موفق" + }, + "pulls.merge.clean_title": "تداخلی با شاخه پایه وجود ندارد", + "pulls.merge.clean_description": "ادغام را می‌توان به صورت خودکار انجام داد.", + "pulls.merge.conflict_title": "این شاخه تداخل‌هایی دارد که باید حل شوند", + "pulls.merge.conflict_description": "پیش از ادامه، تداخل‌ها را با خط فرمان حل کنید.", + "pulls.merge.draft_title": "این تقاضای واکشی هنوز در حال انجام است", + "pulls.merge.draft_description": "تقاضاهای واکشی در حال انجام قابل ادغام نیستند.", + "pulls.merge.command_line_hint": "می‌توانید این را با خط فرمان نیز ادغام کنید.", + "pulls.merged.description": "همه چیز آماده است — شاخه {branch} را می‌توان با خیال راحت حذف کرد.", + "pulls.closed.title": "بسته‌شده با کامیت‌های ادغام‌نشده", + "pulls.closed.description": "این تقاضای واکشی بسته شده است، اما شاخه {branch} کامیت‌های ادغام‌نشده دارد." +} diff --git a/locales/fi-FI.json b/locales/fi-FI.json new file mode 100644 index 00000000..e8ef2378 --- /dev/null +++ b/locales/fi-FI.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Kaikki tarkistukset läpäistiin", + "pulls.checks.title_pending": "Jotkin tarkistukset ovat vielä kesken", + "pulls.checks.title_failure": "Jotkin tarkistukset eivät onnistuneet", + "pulls.checks.title_conflict": "Tarkistukset odottavat ristiriitojen ratkaisemista", + "pulls.checks.count_failing": "{count} epäonnistunut", + "pulls.checks.count_pending": "{count} odottaa", + "pulls.checks.count_skipped": "{count} ohitettu", + "pulls.checks.count_successful": "{count} onnistunut", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} epäonnistunut tarkistus", + "other": "{count} epäonnistunutta tarkistusta" + }, + "pulls.checks.group_pending": { + "one": "{count} odottava tarkistus", + "other": "{count} odottavaa tarkistusta" + }, + "pulls.checks.group_skipped": { + "one": "{count} ohitettu tarkistus", + "other": "{count} ohitettua tarkistusta" + }, + "pulls.checks.group_successful": { + "one": "{count} onnistunut tarkistus", + "other": "{count} onnistunutta tarkistusta" + }, + "pulls.merge.clean_title": "Ei ristiriitoja perushaaran kanssa", + "pulls.merge.clean_description": "Yhdistäminen voidaan tehdä automaattisesti.", + "pulls.merge.conflict_title": "Tässä haarassa on ristiriitoja, jotka on ratkaistava", + "pulls.merge.conflict_description": "Ratkaise ristiriidat komentorivillä ennen jatkamista.", + "pulls.merge.draft_title": "Tämä vetopyyntö on vielä keskeneräinen", + "pulls.merge.draft_description": "Keskeneräisiä vetopyyntöjä ei voi yhdistää.", + "pulls.merge.command_line_hint": "Voit myös yhdistää tämän komentorivillä.", + "pulls.merged.description": "Kaikki valmista – haaran {branch} voi poistaa turvallisesti.", + "pulls.closed.title": "Suljettu yhdistämättömin kommitein", + "pulls.closed.description": "Tämä vetopyyntö on suljettu, mutta haarassa {branch} on yhdistämättömiä kommitteja." +} diff --git a/locales/fil.json b/locales/fil.json new file mode 100644 index 00000000..c939190b --- /dev/null +++ b/locales/fil.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Pumasa ang lahat ng pagsusuri", + "pulls.checks.title_pending": "Hindi pa tapos ang ilang pagsusuri", + "pulls.checks.title_failure": "Hindi nagtagumpay ang ilang pagsusuri", + "pulls.checks.title_conflict": "Naghihintay ang mga pagsusuri na malutas ang mga salungatan", + "pulls.checks.count_failing": "{count} nabigo", + "pulls.checks.count_pending": "{count} nakabinbin", + "pulls.checks.count_skipped": "{count} nilaktawan", + "pulls.checks.count_successful": "{count} nagtagumpay", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} nabigong pagsusuri", + "other": "{count} nabigong pagsusuri" + }, + "pulls.checks.group_pending": { + "one": "{count} nakabinbing pagsusuri", + "other": "{count} nakabinbing pagsusuri" + }, + "pulls.checks.group_skipped": { + "one": "{count} nilaktawang pagsusuri", + "other": "{count} nilaktawang pagsusuri" + }, + "pulls.checks.group_successful": { + "one": "{count} matagumpay na pagsusuri", + "other": "{count} matagumpay na pagsusuri" + }, + "pulls.merge.clean_title": "Walang salungatan sa base na branch", + "pulls.merge.clean_description": "Maaaring gawin nang awtomatiko ang pagsali.", + "pulls.merge.conflict_title": "May mga salungatan ang branch na ito na kailangang lutasin", + "pulls.merge.conflict_description": "Lutasin ang mga salungatan gamit ang command line bago magpatuloy.", + "pulls.merge.draft_title": "Ginagawa pa ang hiling sa paghila na ito", + "pulls.merge.draft_description": "Hindi maisasali ang mga hiling sa paghila na ginagawa pa.", + "pulls.merge.command_line_hint": "Maaari mo rin itong isali gamit ang command line.", + "pulls.merged.description": "Handa na ang lahat — ligtas nang mabubura ang branch na {branch}.", + "pulls.closed.title": "Isinara nang may mga commit na hindi naisali", + "pulls.closed.description": "Sarado na ang hiling sa paghila na ito, pero may mga commit na hindi naisali ang branch na {branch}." +} diff --git a/locales/fr-FR.json b/locales/fr-FR.json new file mode 100644 index 00000000..c731362b --- /dev/null +++ b/locales/fr-FR.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Tous les contrôles ont réussi", + "pulls.checks.title_pending": "Certains contrôles ne sont pas encore terminés", + "pulls.checks.title_failure": "Certains contrôles n'ont pas réussi", + "pulls.checks.title_conflict": "Contrôles en attente de la résolution des conflits", + "pulls.checks.count_failing": "{count} en échec", + "pulls.checks.count_pending": "{count} en attente", + "pulls.checks.count_skipped": "{count} ignoré(s)", + "pulls.checks.count_successful": "{count} réussi(s)", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} contrôle en échec", + "other": "{count} contrôles en échec" + }, + "pulls.checks.group_pending": { + "one": "{count} contrôle en attente", + "other": "{count} contrôles en attente" + }, + "pulls.checks.group_skipped": { + "one": "{count} contrôle ignoré", + "other": "{count} contrôles ignorés" + }, + "pulls.checks.group_successful": { + "one": "{count} contrôle réussi", + "other": "{count} contrôles réussis" + }, + "pulls.merge.clean_title": "Aucun conflit avec la branche de base", + "pulls.merge.clean_description": "La fusion peut être effectuée automatiquement.", + "pulls.merge.conflict_title": "Cette branche contient des conflits à résoudre", + "pulls.merge.conflict_description": "Résolvez les conflits en ligne de commande avant de continuer.", + "pulls.merge.draft_title": "Cette demande d’ajout est encore en chantier", + "pulls.merge.draft_description": "Les demandes d’ajout en chantier ne peuvent pas être fusionnées.", + "pulls.merge.command_line_hint": "Vous pouvez aussi fusionner en ligne de commande.", + "pulls.merged.description": "Tout est prêt — la branche {branch} peut être supprimée sans risque.", + "pulls.closed.title": "Fermée avec des commits non fusionnés", + "pulls.closed.description": "Cette demande d’ajout est fermée, mais la branche {branch} contient des commits non fusionnés." +} diff --git a/locales/hu-HU.json b/locales/hu-HU.json new file mode 100644 index 00000000..7c8af1f5 --- /dev/null +++ b/locales/hu-HU.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Minden ellenőrzés sikeres", + "pulls.checks.title_pending": "Néhány ellenőrzés még nem fejeződött be", + "pulls.checks.title_failure": "Néhány ellenőrzés nem volt sikeres", + "pulls.checks.title_conflict": "Az ellenőrzések az ütközések feloldására várnak", + "pulls.checks.count_failing": "{count} sikertelen", + "pulls.checks.count_pending": "{count} függőben", + "pulls.checks.count_skipped": "{count} kihagyva", + "pulls.checks.count_successful": "{count} sikeres", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} sikertelen ellenőrzés", + "other": "{count} sikertelen ellenőrzés" + }, + "pulls.checks.group_pending": { + "one": "{count} függőben lévő ellenőrzés", + "other": "{count} függőben lévő ellenőrzés" + }, + "pulls.checks.group_skipped": { + "one": "{count} kihagyott ellenőrzés", + "other": "{count} kihagyott ellenőrzés" + }, + "pulls.checks.group_successful": { + "one": "{count} sikeres ellenőrzés", + "other": "{count} sikeres ellenőrzés" + }, + "pulls.merge.clean_title": "Nincs ütközés az alapággal", + "pulls.merge.clean_description": "Az egyesítés automatikusan elvégezhető.", + "pulls.merge.conflict_title": "Ebben az ágban feloldandó ütközések vannak", + "pulls.merge.conflict_description": "Folytatás előtt oldja fel az ütközéseket a parancssorban.", + "pulls.merge.draft_title": "Ez az egyesítési kérés még folyamatban lévő munka", + "pulls.merge.draft_description": "A folyamatban lévő egyesítési kérések nem egyesíthetők.", + "pulls.merge.command_line_hint": "Ezt parancssorból is egyesítheti.", + "pulls.merged.description": "Minden kész – a(z) {branch} ág biztonságosan törölhető.", + "pulls.closed.title": "Lezárva egyesítetlen commitokkal", + "pulls.closed.description": "Ez az egyesítési kérés lezárult, de a(z) {branch} ágban egyesítetlen commitok vannak." +} diff --git a/locales/id-ID.json b/locales/id-ID.json new file mode 100644 index 00000000..2b046edb --- /dev/null +++ b/locales/id-ID.json @@ -0,0 +1,36 @@ +{ + "pulls.checks.title_success": "Semua pemeriksaan telah lulus", + "pulls.checks.title_pending": "Beberapa pemeriksaan belum selesai", + "pulls.checks.title_failure": "Beberapa pemeriksaan tidak berhasil", + "pulls.checks.title_conflict": "Pemeriksaan menunggu penyelesaian konflik", + "pulls.checks.count_failing": "{count} gagal", + "pulls.checks.count_pending": "{count} tertunda", + "pulls.checks.count_skipped": "{count} dilewati", + "pulls.checks.count_successful": "{count} berhasil", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "other": "{list}" + }, + "pulls.checks.group_failing": { + "other": "{count} pemeriksaan gagal" + }, + "pulls.checks.group_pending": { + "other": "{count} pemeriksaan tertunda" + }, + "pulls.checks.group_skipped": { + "other": "{count} pemeriksaan dilewati" + }, + "pulls.checks.group_successful": { + "other": "{count} pemeriksaan berhasil" + }, + "pulls.merge.clean_title": "Tidak ada konflik dengan cabang dasar", + "pulls.merge.clean_description": "Penggabungan dapat dilakukan secara otomatis.", + "pulls.merge.conflict_title": "Cabang ini memiliki konflik yang harus diselesaikan", + "pulls.merge.conflict_description": "Selesaikan konflik melalui baris perintah sebelum melanjutkan.", + "pulls.merge.draft_title": "Permintaan tarik ini masih dalam pengerjaan", + "pulls.merge.draft_description": "Permintaan tarik yang masih dalam pengerjaan tidak dapat digabung.", + "pulls.merge.command_line_hint": "Anda juga dapat menggabungkan ini melalui baris perintah.", + "pulls.merged.description": "Semua siap — cabang {branch} dapat dihapus dengan aman.", + "pulls.closed.title": "Ditutup dengan komit yang belum digabung", + "pulls.closed.description": "Permintaan tarik ini ditutup, tetapi cabang {branch} memiliki komit yang belum digabung." +} diff --git a/locales/it-IT.json b/locales/it-IT.json new file mode 100644 index 00000000..9e6d4df8 --- /dev/null +++ b/locales/it-IT.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Tutti i controlli sono stati superati", + "pulls.checks.title_pending": "Alcuni controlli non sono ancora terminati", + "pulls.checks.title_failure": "Alcuni controlli non sono andati a buon fine", + "pulls.checks.title_conflict": "Controlli in attesa della risoluzione dei conflitti", + "pulls.checks.count_failing": "{count} falliti", + "pulls.checks.count_pending": "{count} in sospeso", + "pulls.checks.count_skipped": "{count} saltati", + "pulls.checks.count_successful": "{count} riusciti", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} controllo fallito", + "other": "{count} controlli falliti" + }, + "pulls.checks.group_pending": { + "one": "{count} controllo in sospeso", + "other": "{count} controlli in sospeso" + }, + "pulls.checks.group_skipped": { + "one": "{count} controllo saltato", + "other": "{count} controlli saltati" + }, + "pulls.checks.group_successful": { + "one": "{count} controllo riuscito", + "other": "{count} controlli riusciti" + }, + "pulls.merge.clean_title": "Nessun conflitto con il ramo di base", + "pulls.merge.clean_description": "La fusione può essere eseguita automaticamente.", + "pulls.merge.conflict_title": "Questo ramo ha conflitti che devono essere risolti", + "pulls.merge.conflict_description": "Risolvi i conflitti dalla riga di comando prima di continuare.", + "pulls.merge.draft_title": "Questa richiesta di modifica è ancora un lavoro in corso", + "pulls.merge.draft_description": "Le richieste di modifica in corso non possono essere fuse.", + "pulls.merge.command_line_hint": "Puoi anche fonderla dalla riga di comando.", + "pulls.merged.description": "Tutto pronto: il ramo {branch} può essere eliminato in sicurezza.", + "pulls.closed.title": "Chiusa con commit non fusi", + "pulls.closed.description": "Questa richiesta di modifica è chiusa, ma il ramo {branch} ha commit non fusi." +} diff --git a/locales/ja-JP.json b/locales/ja-JP.json new file mode 100644 index 00000000..4bf773c7 --- /dev/null +++ b/locales/ja-JP.json @@ -0,0 +1,36 @@ +{ + "pulls.checks.title_success": "すべてのチェックに合格しました", + "pulls.checks.title_pending": "一部のチェックがまだ完了していません", + "pulls.checks.title_failure": "一部のチェックが成功しませんでした", + "pulls.checks.title_conflict": "チェックはコンフリクトの解決を待っています", + "pulls.checks.count_failing": "{count} 件失敗", + "pulls.checks.count_pending": "{count} 件待機中", + "pulls.checks.count_skipped": "{count} 件スキップ", + "pulls.checks.count_successful": "{count} 件成功", + "pulls.checks.list_separator": "、", + "pulls.checks.summary": { + "other": "{list}" + }, + "pulls.checks.group_failing": { + "other": "{count} 件の失敗したチェック" + }, + "pulls.checks.group_pending": { + "other": "{count} 件の待機中のチェック" + }, + "pulls.checks.group_skipped": { + "other": "{count} 件のスキップされたチェック" + }, + "pulls.checks.group_successful": { + "other": "{count} 件の成功したチェック" + }, + "pulls.merge.clean_title": "ベースブランチとのコンフリクトはありません", + "pulls.merge.clean_description": "自動的にマージできます。", + "pulls.merge.conflict_title": "このブランチには解決が必要なコンフリクトがあります", + "pulls.merge.conflict_description": "続行する前に、コマンドラインでコンフリクトを解決してください。", + "pulls.merge.draft_title": "このプルリクエストはまだ作業中です", + "pulls.merge.draft_description": "作業中のプルリクエストはマージできません。", + "pulls.merge.command_line_hint": "コマンドラインでマージすることもできます。", + "pulls.merged.description": "準備完了 — {branch} ブランチは安全に削除できます。", + "pulls.closed.title": "マージされていないコミットを残してクローズ", + "pulls.closed.description": "このプルリクエストはクローズされていますが、{branch} ブランチにはマージされていないコミットがあります。" +} diff --git a/locales/ko-KR.json b/locales/ko-KR.json new file mode 100644 index 00000000..017f42d5 --- /dev/null +++ b/locales/ko-KR.json @@ -0,0 +1,36 @@ +{ + "pulls.checks.title_success": "모든 확인을 통과했습니다", + "pulls.checks.title_pending": "일부 확인이 아직 완료되지 않았습니다", + "pulls.checks.title_failure": "일부 확인이 성공하지 못했습니다", + "pulls.checks.title_conflict": "확인이 충돌 해결을 기다리고 있습니다", + "pulls.checks.count_failing": "실패 {count}개", + "pulls.checks.count_pending": "대기 중 {count}개", + "pulls.checks.count_skipped": "건너뜀 {count}개", + "pulls.checks.count_successful": "성공 {count}개", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "other": "{list}" + }, + "pulls.checks.group_failing": { + "other": "실패한 확인 {count}개" + }, + "pulls.checks.group_pending": { + "other": "대기 중인 확인 {count}개" + }, + "pulls.checks.group_skipped": { + "other": "건너뛴 확인 {count}개" + }, + "pulls.checks.group_successful": { + "other": "성공한 확인 {count}개" + }, + "pulls.merge.clean_title": "기본 브랜치와 충돌이 없습니다", + "pulls.merge.clean_description": "자동으로 병합할 수 있습니다.", + "pulls.merge.conflict_title": "이 브랜치에 해결해야 할 충돌이 있습니다", + "pulls.merge.conflict_description": "계속하기 전에 명령줄에서 충돌을 해결하세요.", + "pulls.merge.draft_title": "이 pull 요청은 아직 진행 중인 작업입니다", + "pulls.merge.draft_description": "진행 중인 pull 요청은 병합할 수 없습니다.", + "pulls.merge.command_line_hint": "명령줄에서 병합할 수도 있습니다.", + "pulls.merged.description": "모두 완료되었습니다 — {branch} 브랜치를 안전하게 삭제할 수 있습니다.", + "pulls.closed.title": "병합되지 않은 커밋과 함께 종료됨", + "pulls.closed.description": "이 pull 요청은 종료되었지만 {branch} 브랜치에 병합되지 않은 커밋이 있습니다." +} diff --git a/locales/lv-LV.json b/locales/lv-LV.json new file mode 100644 index 00000000..0a0e4bed --- /dev/null +++ b/locales/lv-LV.json @@ -0,0 +1,46 @@ +{ + "pulls.checks.title_success": "Visas pārbaudes ir izpildītas", + "pulls.checks.title_pending": "Dažas pārbaudes vēl nav pabeigtas", + "pulls.checks.title_failure": "Dažas pārbaudes neizdevās", + "pulls.checks.title_conflict": "Pārbaudes gaida konfliktu atrisināšanu", + "pulls.checks.count_failing": "neizdevās: {count}", + "pulls.checks.count_pending": "gaida: {count}", + "pulls.checks.count_skipped": "izlaistas: {count}", + "pulls.checks.count_successful": "izdevās: {count}", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "zero": "{list}", + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "zero": "{count} neizdevušās pārbaudes", + "one": "{count} neizdevusies pārbaude", + "other": "{count} neizdevušās pārbaudes" + }, + "pulls.checks.group_pending": { + "zero": "{count} gaidošas pārbaudes", + "one": "{count} gaidoša pārbaude", + "other": "{count} gaidošas pārbaudes" + }, + "pulls.checks.group_skipped": { + "zero": "{count} izlaistas pārbaudes", + "one": "{count} izlaista pārbaude", + "other": "{count} izlaistas pārbaudes" + }, + "pulls.checks.group_successful": { + "zero": "{count} izdevušās pārbaudes", + "one": "{count} izdevusies pārbaude", + "other": "{count} izdevušās pārbaudes" + }, + "pulls.merge.clean_title": "Nav konfliktu ar bāzes zaru", + "pulls.merge.clean_description": "Apvienošanu var veikt automātiski.", + "pulls.merge.conflict_title": "Šajā zarā ir konflikti, kas jāatrisina", + "pulls.merge.conflict_description": "Pirms turpināt, atrisiniet konfliktus komandrindā.", + "pulls.merge.draft_title": "Šis izmaiņu pieprasījums vēl ir nepabeigts darbs", + "pulls.merge.draft_description": "Nepabeigtus izmaiņu pieprasījumus nevar apvienot.", + "pulls.merge.command_line_hint": "To var apvienot arī no komandrindas.", + "pulls.merged.description": "Viss gatavs — zaru {branch} var droši izdzēst.", + "pulls.closed.title": "Aizvērts ar neapvienotiem iesūtījumiem", + "pulls.closed.description": "Šis izmaiņu pieprasījums ir aizvērts, bet zarā {branch} ir neapvienoti iesūtījumi." +} diff --git a/locales/nds.json b/locales/nds.json new file mode 100644 index 00000000..002c9dcb --- /dev/null +++ b/locales/nds.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "All Överprüfens sünd dörgahn", + "pulls.checks.title_pending": "Eenige Överprüfens sünd noch nich klaar", + "pulls.checks.title_failure": "Eenige Överprüfens weren nich mit Spood", + "pulls.checks.title_conflict": "Överprüfens töven up dat Lösen vun de Konflikten", + "pulls.checks.count_failing": "{count} fehlslagen", + "pulls.checks.count_pending": "{count} utstahnd", + "pulls.checks.count_skipped": "{count} översprungen", + "pulls.checks.count_successful": "{count} mit Spood", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} fehlslagen Överprüfen", + "other": "{count} fehlslagen Överprüfens" + }, + "pulls.checks.group_pending": { + "one": "{count} utstahnd Överprüfen", + "other": "{count} utstahnd Överprüfens" + }, + "pulls.checks.group_skipped": { + "one": "{count} översprungen Överprüfen", + "other": "{count} översprungen Överprüfens" + }, + "pulls.checks.group_successful": { + "one": "{count} Överprüfen mit Spood", + "other": "{count} Överprüfens mit Spood" + }, + "pulls.merge.clean_title": "Keen Konflikten mit de Grund-Twieg", + "pulls.merge.clean_description": "Dat Tosamenföhren kann automatisk passeren.", + "pulls.merge.conflict_title": "Deese Twieg hett Konflikten, wat lööst worden mutten", + "pulls.merge.conflict_description": "Löös de Konflikten över de Befehlsreeg, ehr du wiedermaakst.", + "pulls.merge.draft_title": "Deeser Haalvörslag is noch in de Maak", + "pulls.merge.draft_description": "Haalvörslagen in de Maak könen nich tosamenföhrt worden.", + "pulls.merge.command_line_hint": "Du kannst dat ok över de Befehlsreeg tosamenföhren.", + "pulls.merged.description": "All klaar – de Twieg {branch} kann nu ohn Sorg lösket worden.", + "pulls.closed.title": "Dichtmaakt mit nich tosamenföhrten Commits", + "pulls.closed.description": "Deeser Haalvörslag is dicht, man de Twieg {branch} hett nich tosamenföhrte Commits." +} diff --git a/locales/nl-NL.json b/locales/nl-NL.json new file mode 100644 index 00000000..fa65ff43 --- /dev/null +++ b/locales/nl-NL.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Alle controles zijn geslaagd", + "pulls.checks.title_pending": "Sommige controles zijn nog niet voltooid", + "pulls.checks.title_failure": "Sommige controles zijn niet geslaagd", + "pulls.checks.title_conflict": "Controles wachten op het oplossen van conflicten", + "pulls.checks.count_failing": "{count} mislukt", + "pulls.checks.count_pending": "{count} in behandeling", + "pulls.checks.count_skipped": "{count} overgeslagen", + "pulls.checks.count_successful": "{count} geslaagd", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} mislukte controle", + "other": "{count} mislukte controles" + }, + "pulls.checks.group_pending": { + "one": "{count} controle in behandeling", + "other": "{count} controles in behandeling" + }, + "pulls.checks.group_skipped": { + "one": "{count} overgeslagen controle", + "other": "{count} overgeslagen controles" + }, + "pulls.checks.group_successful": { + "one": "{count} geslaagde controle", + "other": "{count} geslaagde controles" + }, + "pulls.merge.clean_title": "Geen conflicten met de basis-branch", + "pulls.merge.clean_description": "Samenvoegen kan automatisch worden uitgevoerd.", + "pulls.merge.conflict_title": "Deze branch heeft conflicten die opgelost moeten worden", + "pulls.merge.conflict_description": "Los de conflicten op via de opdrachtregel voordat je verdergaat.", + "pulls.merge.draft_title": "Dit pull request is nog werk in uitvoering", + "pulls.merge.draft_description": "Pull requests in uitvoering kunnen niet worden samengevoegd.", + "pulls.merge.command_line_hint": "Je kunt dit ook samenvoegen via de opdrachtregel.", + "pulls.merged.description": "Alles is klaar — de branch {branch} kan veilig worden verwijderd.", + "pulls.closed.title": "Gesloten met niet-samengevoegde commits", + "pulls.closed.description": "Dit pull request is gesloten, maar de branch {branch} heeft commits die niet zijn samengevoegd." +} diff --git a/locales/pl-PL.json b/locales/pl-PL.json new file mode 100644 index 00000000..37ec16b7 --- /dev/null +++ b/locales/pl-PL.json @@ -0,0 +1,46 @@ +{ + "pulls.checks.title_success": "Wszystkie kontrole zakończyły się powodzeniem", + "pulls.checks.title_pending": "Niektóre kontrole jeszcze się nie zakończyły", + "pulls.checks.title_failure": "Niektóre kontrole nie powiodły się", + "pulls.checks.title_conflict": "Kontrole czekają na rozwiązanie konfliktów", + "pulls.checks.count_failing": "nieudane: {count}", + "pulls.checks.count_pending": "oczekujące: {count}", + "pulls.checks.count_skipped": "pominięte: {count}", + "pulls.checks.count_successful": "udane: {count}", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "few": "{list}", + "many": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} nieudana kontrola", + "few": "{count} nieudane kontrole", + "many": "{count} nieudanych kontroli" + }, + "pulls.checks.group_pending": { + "one": "{count} oczekująca kontrola", + "few": "{count} oczekujące kontrole", + "many": "{count} oczekujących kontroli" + }, + "pulls.checks.group_skipped": { + "one": "{count} pominięta kontrola", + "few": "{count} pominięte kontrole", + "many": "{count} pominiętych kontroli" + }, + "pulls.checks.group_successful": { + "one": "{count} udana kontrola", + "few": "{count} udane kontrole", + "many": "{count} udanych kontroli" + }, + "pulls.merge.clean_title": "Brak konfliktów z gałęzią bazową", + "pulls.merge.clean_description": "Scalenie może zostać wykonane automatycznie.", + "pulls.merge.conflict_title": "Ta gałąź ma konflikty, które trzeba rozwiązać", + "pulls.merge.conflict_description": "Rozwiąż konflikty w wierszu poleceń, zanim przejdziesz dalej.", + "pulls.merge.draft_title": "Ten pull request jest wciąż pracą w toku", + "pulls.merge.draft_description": "Pull requestów w toku nie można scalić.", + "pulls.merge.command_line_hint": "Możesz też scalić to z wiersza poleceń.", + "pulls.merged.description": "Wszystko gotowe — gałąź {branch} można bezpiecznie usunąć.", + "pulls.closed.title": "Zamknięty z nie scalonymi commitami", + "pulls.closed.description": "Ten pull request jest zamknięty, ale gałąź {branch} ma nie scalone commity." +} diff --git a/locales/pt-BR.json b/locales/pt-BR.json new file mode 100644 index 00000000..1d9f0a0d --- /dev/null +++ b/locales/pt-BR.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Todas as verificações foram aprovadas", + "pulls.checks.title_pending": "Algumas verificações ainda não foram concluídas", + "pulls.checks.title_failure": "Algumas verificações não foram bem-sucedidas", + "pulls.checks.title_conflict": "Verificações aguardando a resolução dos conflitos", + "pulls.checks.count_failing": "{count} com falha", + "pulls.checks.count_pending": "{count} pendente(s)", + "pulls.checks.count_skipped": "{count} ignorada(s)", + "pulls.checks.count_successful": "{count} bem-sucedida(s)", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} verificação com falha", + "other": "{count} verificações com falha" + }, + "pulls.checks.group_pending": { + "one": "{count} verificação pendente", + "other": "{count} verificações pendentes" + }, + "pulls.checks.group_skipped": { + "one": "{count} verificação ignorada", + "other": "{count} verificações ignoradas" + }, + "pulls.checks.group_successful": { + "one": "{count} verificação bem-sucedida", + "other": "{count} verificações bem-sucedidas" + }, + "pulls.merge.clean_title": "Nenhum conflito com o branch base", + "pulls.merge.clean_description": "O merge pode ser aplicado automaticamente.", + "pulls.merge.conflict_title": "Este branch tem conflitos que precisam ser resolvidos", + "pulls.merge.conflict_description": "Resolva os conflitos pela linha de comando antes de continuar.", + "pulls.merge.draft_title": "Este pull request ainda é um trabalho em andamento", + "pulls.merge.draft_description": "Pull requests em andamento não podem receber merge.", + "pulls.merge.command_line_hint": "Você também pode aplicar o merge pela linha de comando.", + "pulls.merged.description": "Tudo pronto — o branch {branch} pode ser excluído com segurança.", + "pulls.closed.title": "Fechado com commits sem merge", + "pulls.closed.description": "Este pull request está fechado, mas o branch {branch} tem commits sem merge." +} diff --git a/locales/pt-PT.json b/locales/pt-PT.json new file mode 100644 index 00000000..84ff6893 --- /dev/null +++ b/locales/pt-PT.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Todas as verificações foram aprovadas", + "pulls.checks.title_pending": "Algumas verificações ainda não terminaram", + "pulls.checks.title_failure": "Algumas verificações não foram bem-sucedidas", + "pulls.checks.title_conflict": "Verificações a aguardar a resolução dos conflitos", + "pulls.checks.count_failing": "{count} falhadas", + "pulls.checks.count_pending": "{count} pendentes", + "pulls.checks.count_skipped": "{count} ignoradas", + "pulls.checks.count_successful": "{count} bem-sucedidas", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} verificação falhada", + "other": "{count} verificações falhadas" + }, + "pulls.checks.group_pending": { + "one": "{count} verificação pendente", + "other": "{count} verificações pendentes" + }, + "pulls.checks.group_skipped": { + "one": "{count} verificação ignorada", + "other": "{count} verificações ignoradas" + }, + "pulls.checks.group_successful": { + "one": "{count} verificação bem-sucedida", + "other": "{count} verificações bem-sucedidas" + }, + "pulls.merge.clean_title": "Sem conflitos com o ramo base", + "pulls.merge.clean_description": "A integração pode ser feita automaticamente.", + "pulls.merge.conflict_title": "Este ramo tem conflitos que têm de ser resolvidos", + "pulls.merge.conflict_description": "Resolva os conflitos pela linha de comandos antes de continuar.", + "pulls.merge.draft_title": "Este pedido de integração ainda é um trabalho em andamento", + "pulls.merge.draft_description": "Pedidos de integração em andamento não podem ser integrados.", + "pulls.merge.command_line_hint": "Também pode integrar isto pela linha de comandos.", + "pulls.merged.description": "Está tudo pronto — o ramo {branch} pode ser eliminado em segurança.", + "pulls.closed.title": "Fechado com cometimentos não integrados", + "pulls.closed.description": "Este pedido de integração está fechado, mas o ramo {branch} tem cometimentos não integrados." +} diff --git a/locales/ru-RU.json b/locales/ru-RU.json new file mode 100644 index 00000000..b71aa497 --- /dev/null +++ b/locales/ru-RU.json @@ -0,0 +1,46 @@ +{ + "pulls.checks.title_success": "Все проверки пройдены", + "pulls.checks.title_pending": "Некоторые проверки ещё не завершены", + "pulls.checks.title_failure": "Некоторые проверки не прошли", + "pulls.checks.title_conflict": "Проверки ожидают разрешения конфликтов", + "pulls.checks.count_failing": "не пройдено: {count}", + "pulls.checks.count_pending": "ожидает: {count}", + "pulls.checks.count_skipped": "пропущено: {count}", + "pulls.checks.count_successful": "пройдено: {count}", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "few": "{list}", + "many": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} непройденная проверка", + "few": "{count} непройденные проверки", + "many": "{count} непройденных проверок" + }, + "pulls.checks.group_pending": { + "one": "{count} ожидающая проверка", + "few": "{count} ожидающие проверки", + "many": "{count} ожидающих проверок" + }, + "pulls.checks.group_skipped": { + "one": "{count} пропущенная проверка", + "few": "{count} пропущенные проверки", + "many": "{count} пропущенных проверок" + }, + "pulls.checks.group_successful": { + "one": "{count} пройденная проверка", + "few": "{count} пройденные проверки", + "many": "{count} пройденных проверок" + }, + "pulls.merge.clean_title": "Нет конфликтов с базовой веткой", + "pulls.merge.clean_description": "Слияние может быть выполнено автоматически.", + "pulls.merge.conflict_title": "В этой ветке есть конфликты, которые нужно разрешить", + "pulls.merge.conflict_description": "Разрешите конфликты в командной строке, прежде чем продолжить.", + "pulls.merge.draft_title": "Этот запрос на слияние ещё в работе", + "pulls.merge.draft_description": "Запросы на слияние, которые ещё в работе, нельзя слить.", + "pulls.merge.command_line_hint": "Это также можно слить из командной строки.", + "pulls.merged.description": "Всё готово — ветку {branch} можно безопасно удалить.", + "pulls.closed.title": "Закрыт с неслитыми коммитами", + "pulls.closed.description": "Этот запрос на слияние закрыт, но в ветке {branch} есть неслитые коммиты." +} diff --git a/locales/sl.json b/locales/sl.json new file mode 100644 index 00000000..db5ef5ba --- /dev/null +++ b/locales/sl.json @@ -0,0 +1,51 @@ +{ + "pulls.checks.title_success": "Vsa preverjanja so uspela", + "pulls.checks.title_pending": "Nekatera preverjanja še niso končana", + "pulls.checks.title_failure": "Nekatera preverjanja niso uspela", + "pulls.checks.title_conflict": "Preverjanja čakajo na razrešitev sporov", + "pulls.checks.count_failing": "neuspešna: {count}", + "pulls.checks.count_pending": "v čakanju: {count}", + "pulls.checks.count_skipped": "preskočena: {count}", + "pulls.checks.count_successful": "uspešna: {count}", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "two": "{list}", + "few": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} neuspešno preverjanje", + "two": "{count} neuspešni preverjanji", + "few": "{count} neuspešna preverjanja", + "other": "{count} neuspešnih preverjanj" + }, + "pulls.checks.group_pending": { + "one": "{count} preverjanje v čakanju", + "two": "{count} preverjanji v čakanju", + "few": "{count} preverjanja v čakanju", + "other": "{count} preverjanj v čakanju" + }, + "pulls.checks.group_skipped": { + "one": "{count} preskočeno preverjanje", + "two": "{count} preskočeni preverjanji", + "few": "{count} preskočena preverjanja", + "other": "{count} preskočenih preverjanj" + }, + "pulls.checks.group_successful": { + "one": "{count} uspešno preverjanje", + "two": "{count} uspešni preverjanji", + "few": "{count} uspešna preverjanja", + "other": "{count} uspešnih preverjanj" + }, + "pulls.merge.clean_title": "Ni sporov z osnovno vejo", + "pulls.merge.clean_description": "Združitev je mogoče izvesti samodejno.", + "pulls.merge.conflict_title": "Ta veja ima spore, ki jih je treba razrešiti", + "pulls.merge.conflict_description": "Pred nadaljevanjem razrešite spore v ukazni vrstici.", + "pulls.merge.draft_title": "Ta zahteva za združitev je še v delu", + "pulls.merge.draft_description": "Zahtev za združitev, ki so še v delu, ni mogoče združiti.", + "pulls.merge.command_line_hint": "To lahko združite tudi iz ukazne vrstice.", + "pulls.merged.description": "Vse je pripravljeno — vejo {branch} lahko varno izbrišete.", + "pulls.closed.title": "Zaprto z nezdruženimi uveljavitvami", + "pulls.closed.description": "Ta zahteva za združitev je zaprta, vendar ima veja {branch} nezdružene uveljavitve." +} diff --git a/locales/sv-SE.json b/locales/sv-SE.json new file mode 100644 index 00000000..f59fae34 --- /dev/null +++ b/locales/sv-SE.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Alla kontroller har godkänts", + "pulls.checks.title_pending": "Vissa kontroller är inte klara än", + "pulls.checks.title_failure": "Vissa kontroller lyckades inte", + "pulls.checks.title_conflict": "Kontroller väntar på att konflikterna löses", + "pulls.checks.count_failing": "{count} misslyckade", + "pulls.checks.count_pending": "{count} väntande", + "pulls.checks.count_skipped": "{count} överhoppade", + "pulls.checks.count_successful": "{count} lyckade", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} misslyckad kontroll", + "other": "{count} misslyckade kontroller" + }, + "pulls.checks.group_pending": { + "one": "{count} väntande kontroll", + "other": "{count} väntande kontroller" + }, + "pulls.checks.group_skipped": { + "one": "{count} överhoppad kontroll", + "other": "{count} överhoppade kontroller" + }, + "pulls.checks.group_successful": { + "one": "{count} lyckad kontroll", + "other": "{count} lyckade kontroller" + }, + "pulls.merge.clean_title": "Inga konflikter med basgrenen", + "pulls.merge.clean_description": "Sammanslagningen kan utföras automatiskt.", + "pulls.merge.conflict_title": "Den här grenen har konflikter som måste lösas", + "pulls.merge.conflict_description": "Lös konflikterna via kommandoraden innan du fortsätter.", + "pulls.merge.draft_title": "Denna ändringsförfrågan är fortfarande ett pågående arbete", + "pulls.merge.draft_description": "Pågående ändringsförfrågningar kan inte slås samman.", + "pulls.merge.command_line_hint": "Du kan också slå samman detta via kommandoraden.", + "pulls.merged.description": "Allt klart – grenen {branch} kan tas bort utan risk.", + "pulls.closed.title": "Stängd med commits som inte slagits samman", + "pulls.closed.description": "Denna ändringsförfrågan är stängd, men grenen {branch} har commits som inte slagits samman." +} diff --git a/locales/tr-TR.json b/locales/tr-TR.json new file mode 100644 index 00000000..c4a87147 --- /dev/null +++ b/locales/tr-TR.json @@ -0,0 +1,41 @@ +{ + "pulls.checks.title_success": "Tüm kontroller başarılı oldu", + "pulls.checks.title_pending": "Bazı kontroller henüz tamamlanmadı", + "pulls.checks.title_failure": "Bazı kontroller başarılı olmadı", + "pulls.checks.title_conflict": "Kontroller çakışmaların çözülmesini bekliyor", + "pulls.checks.count_failing": "{count} başarısız", + "pulls.checks.count_pending": "{count} beklemede", + "pulls.checks.count_skipped": "{count} atlandı", + "pulls.checks.count_successful": "{count} başarılı", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "other": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} başarısız kontrol", + "other": "{count} başarısız kontrol" + }, + "pulls.checks.group_pending": { + "one": "{count} bekleyen kontrol", + "other": "{count} bekleyen kontrol" + }, + "pulls.checks.group_skipped": { + "one": "{count} atlanan kontrol", + "other": "{count} atlanan kontrol" + }, + "pulls.checks.group_successful": { + "one": "{count} başarılı kontrol", + "other": "{count} başarılı kontrol" + }, + "pulls.merge.clean_title": "Temel dalla çakışma yok", + "pulls.merge.clean_description": "Birleştirme otomatik olarak yapılabilir.", + "pulls.merge.conflict_title": "Bu dalda çözülmesi gereken çakışmalar var", + "pulls.merge.conflict_description": "Devam etmeden önce çakışmaları komut satırından çözün.", + "pulls.merge.draft_title": "Bu değişiklik isteği hâlâ üzerinde çalışılıyor", + "pulls.merge.draft_description": "Üzerinde çalışılan değişiklik istekleri birleştirilemez.", + "pulls.merge.command_line_hint": "Bunu komut satırından da birleştirebilirsiniz.", + "pulls.merged.description": "Her şey hazır — {branch} dalı güvenle silinebilir.", + "pulls.closed.title": "Birleştirilmemiş işlemelerle kapatıldı", + "pulls.closed.description": "Bu değişiklik isteği kapatıldı, ancak {branch} dalında birleştirilmemiş işlemeler var." +} diff --git a/locales/uk-UA.json b/locales/uk-UA.json new file mode 100644 index 00000000..fc1d8bbc --- /dev/null +++ b/locales/uk-UA.json @@ -0,0 +1,46 @@ +{ + "pulls.checks.title_success": "Усі перевірки пройдено", + "pulls.checks.title_pending": "Деякі перевірки ще не завершено", + "pulls.checks.title_failure": "Деякі перевірки не пройшли", + "pulls.checks.title_conflict": "Перевірки очікують розв’язання конфліктів", + "pulls.checks.count_failing": "не пройдено: {count}", + "pulls.checks.count_pending": "очікує: {count}", + "pulls.checks.count_skipped": "пропущено: {count}", + "pulls.checks.count_successful": "пройдено: {count}", + "pulls.checks.list_separator": ", ", + "pulls.checks.summary": { + "one": "{list}", + "few": "{list}", + "many": "{list}" + }, + "pulls.checks.group_failing": { + "one": "{count} непройдена перевірка", + "few": "{count} непройдені перевірки", + "many": "{count} непройдених перевірок" + }, + "pulls.checks.group_pending": { + "one": "{count} очікувана перевірка", + "few": "{count} очікувані перевірки", + "many": "{count} очікуваних перевірок" + }, + "pulls.checks.group_skipped": { + "one": "{count} пропущена перевірка", + "few": "{count} пропущені перевірки", + "many": "{count} пропущених перевірок" + }, + "pulls.checks.group_successful": { + "one": "{count} пройдена перевірка", + "few": "{count} пройдені перевірки", + "many": "{count} пройдених перевірок" + }, + "pulls.merge.clean_title": "Немає конфліктів з базовою гілкою", + "pulls.merge.clean_description": "Злиття можна виконати автоматично.", + "pulls.merge.conflict_title": "У цій гілці є конфлікти, які потрібно розв’язати", + "pulls.merge.conflict_description": "Розв’яжіть конфлікти в командному рядку, перш ніж продовжити.", + "pulls.merge.draft_title": "Цей запит на злиття ще в роботі", + "pulls.merge.draft_description": "Запити на злиття, які ще в роботі, не можна злити.", + "pulls.merge.command_line_hint": "Це також можна злити з командного рядка.", + "pulls.merged.description": "Усе готово — гілку {branch} можна безпечно видалити.", + "pulls.closed.title": "Закрито з незлитими комітами", + "pulls.closed.description": "Цей запит на злиття закрито, але гілка {branch} має незлиті коміти." +} diff --git a/locales/zh-CN.json b/locales/zh-CN.json new file mode 100644 index 00000000..744e28de --- /dev/null +++ b/locales/zh-CN.json @@ -0,0 +1,36 @@ +{ + "pulls.checks.title_success": "所有检测均已通过", + "pulls.checks.title_pending": "部分检测尚未完成", + "pulls.checks.title_failure": "部分检测未通过", + "pulls.checks.title_conflict": "检测正在等待冲突解决", + "pulls.checks.count_failing": "{count} 个失败", + "pulls.checks.count_pending": "{count} 个等待中", + "pulls.checks.count_skipped": "{count} 个已跳过", + "pulls.checks.count_successful": "{count} 个成功", + "pulls.checks.list_separator": ",", + "pulls.checks.summary": { + "other": "{list}" + }, + "pulls.checks.group_failing": { + "other": "{count} 个失败的检测" + }, + "pulls.checks.group_pending": { + "other": "{count} 个等待中的检测" + }, + "pulls.checks.group_skipped": { + "other": "{count} 个已跳过的检测" + }, + "pulls.checks.group_successful": { + "other": "{count} 个成功的检测" + }, + "pulls.merge.clean_title": "与基础分支没有冲突", + "pulls.merge.clean_description": "可以自动合并。", + "pulls.merge.conflict_title": "此分支存在必须解决的冲突", + "pulls.merge.conflict_description": "请先使用命令行解决冲突再继续。", + "pulls.merge.draft_title": "此合并请求仍在进行中", + "pulls.merge.draft_description": "进行中的合并请求无法合并。", + "pulls.merge.command_line_hint": "你也可以使用命令行合并。", + "pulls.merged.description": "一切就绪 — 可以放心删除 {branch} 分支。", + "pulls.closed.title": "已关闭,含未合并的提交", + "pulls.closed.description": "此合并请求已关闭,但 {branch} 分支含有未合并的提交。" +} diff --git a/locales/zh-HK.json b/locales/zh-HK.json new file mode 100644 index 00000000..31466920 --- /dev/null +++ b/locales/zh-HK.json @@ -0,0 +1,36 @@ +{ + "pulls.checks.title_success": "所有檢查均已通過", + "pulls.checks.title_pending": "部分檢查尚未完成", + "pulls.checks.title_failure": "部分檢查未通過", + "pulls.checks.title_conflict": "檢查正在等待衝突解決", + "pulls.checks.count_failing": "{count} 個失敗", + "pulls.checks.count_pending": "{count} 個等待中", + "pulls.checks.count_skipped": "{count} 個已略過", + "pulls.checks.count_successful": "{count} 個成功", + "pulls.checks.list_separator": ",", + "pulls.checks.summary": { + "other": "{list}" + }, + "pulls.checks.group_failing": { + "other": "{count} 個失敗的檢查" + }, + "pulls.checks.group_pending": { + "other": "{count} 個等待中的檢查" + }, + "pulls.checks.group_skipped": { + "other": "{count} 個已略過的檢查" + }, + "pulls.checks.group_successful": { + "other": "{count} 個成功的檢查" + }, + "pulls.merge.clean_title": "與基礎分支沒有衝突", + "pulls.merge.clean_description": "可以自動合併。", + "pulls.merge.conflict_title": "此分支有必須解決的衝突", + "pulls.merge.conflict_description": "請先使用命令列解決衝突再繼續。", + "pulls.merge.draft_title": "此合併請求仍在進行中", + "pulls.merge.draft_description": "進行中的合併請求無法合併。", + "pulls.merge.command_line_hint": "你亦可以使用命令列合併。", + "pulls.merged.description": "一切就緒 — 可以放心刪除 {branch} 分支。", + "pulls.closed.title": "已關閉,含未合併的提交", + "pulls.closed.description": "此合併請求已關閉,但 {branch} 分支含有未合併的提交。" +} diff --git a/locales/zh-TW.json b/locales/zh-TW.json new file mode 100644 index 00000000..c2a511fb --- /dev/null +++ b/locales/zh-TW.json @@ -0,0 +1,36 @@ +{ + "pulls.checks.title_success": "所有檢查皆已通過", + "pulls.checks.title_pending": "部分檢查尚未完成", + "pulls.checks.title_failure": "部分檢查未通過", + "pulls.checks.title_conflict": "檢查正在等待衝突解決", + "pulls.checks.count_failing": "{count} 個失敗", + "pulls.checks.count_pending": "{count} 個等待中", + "pulls.checks.count_skipped": "{count} 個已略過", + "pulls.checks.count_successful": "{count} 個成功", + "pulls.checks.list_separator": ",", + "pulls.checks.summary": { + "other": "{list}" + }, + "pulls.checks.group_failing": { + "other": "{count} 個失敗的檢查" + }, + "pulls.checks.group_pending": { + "other": "{count} 個等待中的檢查" + }, + "pulls.checks.group_skipped": { + "other": "{count} 個已略過的檢查" + }, + "pulls.checks.group_successful": { + "other": "{count} 個成功的檢查" + }, + "pulls.merge.clean_title": "與基礎分支沒有衝突", + "pulls.merge.clean_description": "可以自動合併。", + "pulls.merge.conflict_title": "此分支有必須解決的衝突", + "pulls.merge.conflict_description": "請先使用命令列解決衝突再繼續。", + "pulls.merge.draft_title": "此合併請求仍在進行中", + "pulls.merge.draft_description": "進行中的合併請求無法合併。", + "pulls.merge.command_line_hint": "你也可以使用命令列合併。", + "pulls.merged.description": "一切就緒 — 可以放心刪除 {branch} 分支。", + "pulls.closed.title": "已關閉,含有未合併的提交", + "pulls.closed.description": "此合併請求已關閉,但 {branch} 分支含有未合併的提交。" +} diff --git a/scripts/assembleForgejo.ts b/scripts/assembleForgejo.ts index eac84840..c4e2b679 100644 --- a/scripts/assembleForgejo.ts +++ b/scripts/assembleForgejo.ts @@ -3,6 +3,8 @@ import { createHash } from "node:crypto"; import { cpSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs"; import { join } from "node:path"; +import { buildPhraseTemplate, forgejoWordingTemplate, readPhrases } from "./phrases.ts"; + const root = process.cwd(); const output = join(root, "dist", "forgejo"); const templates = join(output, "templates"); @@ -29,6 +31,15 @@ const copyTemplates = (source: string, target: string): void => { }; copyTemplates(join(root, "components"), join(templates, "components")); +// The template theme/phrase: Forgejo's wording in the templates pack, and GitHub's from the theme's phrases in the +// optional add-on, which admins extract over the pack; see scripts/phrases.ts. +mkdirSync(join(templates, "theme"), { recursive: true }); +writeFileSync(join(templates, "theme", "phrase.tmpl"), forgejoWordingTemplate); +const githubWording = join(root, "dist", "github-wording", "templates", "theme"); +rmSync(join(root, "dist", "github-wording"), { recursive: true, force: true }); +mkdirSync(githubWording, { recursive: true }); +writeFileSync(join(githubWording, "phrase.tmpl"), buildPhraseTemplate(readPhrases(join(root, "locales")))); + for (const directory of readdirSync(join(root, "components"))) { const source = join(root, "components", directory); for (const component of readdirSync(source, { withFileTypes: true })) { diff --git a/scripts/phrases.test.ts b/scripts/phrases.test.ts new file mode 100644 index 00000000..da515a55 --- /dev/null +++ b/scripts/phrases.test.ts @@ -0,0 +1,82 @@ +import { join } from "node:path"; +import { describe, expect, it } from "vitest"; + +import { + buildPhraseTemplate, + forgejoWordingTemplate, + languageRules, + placeholdersOf, + pluralForms, + readPhrases, + selectPluralForm, + type Phrase, +} from "./phrases.ts"; + +const phrases = readPhrases(join(import.meta.dirname, "..", "locales")); +const english = phrases["en-US"]; +const textsOf = (phrase: Phrase): string[] => (typeof phrase === "string" ? [phrase] : Object.values(phrase)); + +describe("theme phrases", () => { + it("cover every language Forgejo enables by default", () => { + expect(Object.keys(phrases).sort()).toEqual(Object.keys(languageRules).sort()); + }); + + for (const [language, entries] of Object.entries(phrases)) { + describe(language, () => { + it("has exactly the English keys", () => { + expect(Object.keys(entries).sort()).toEqual(Object.keys(english).sort()); + }); + + it("words a phrase as English does: one string, or a plural with the language's forms", () => { + for (const [key, phrase] of Object.entries(entries)) { + expect(typeof phrase, key).toBe(typeof english[key]); + if (typeof phrase !== "string") + expect(Object.keys(phrase).sort(), key).toEqual([...pluralForms(language)].sort()); + } + }); + + it("uses the placeholders English uses", () => { + for (const [key, phrase] of Object.entries(entries)) { + const expected = placeholdersOf(textsOf(english[key])[0]); + for (const text of textsOf(phrase)) expect(placeholdersOf(text), `${key}: ${text}`).toEqual(expected); + } + }); + + it("has no empty phrase", () => { + for (const [key, phrase] of Object.entries(entries)) + for (const text of textsOf(phrase)) expect(text.trim(), key).not.toBe(""); + }); + }); + } + + it("picks Forgejo's plural forms", () => { + expect([0, 1, 2].map(n => selectPluralForm("en-US", n))).toEqual(["other", "one", "other"]); + expect([0, 1, 2].map(n => selectPluralForm("fr-FR", n))).toEqual(["one", "one", "other"]); + expect([1, 2, 5, 11, 21, 22, 25].map(n => selectPluralForm("ru-RU", n))).toEqual([ + "one", + "few", + "many", + "many", + "one", + "few", + "many", + ]); + expect([1, 2, 5, 22].map(n => selectPluralForm("pl-PL", n))).toEqual(["one", "few", "many", "few"]); + expect([1, 3, 5].map(n => selectPluralForm("cs-CZ", n))).toEqual(["one", "few", "other"]); + expect([1, 2, 3, 5, 101].map(n => selectPluralForm("sl", n))).toEqual(["one", "two", "few", "other", "one"]); + expect([0, 1, 2, 11, 21].map(n => selectPluralForm("lv-LV", n))).toEqual(["zero", "one", "other", "zero", "one"]); + expect([1, 7].map(n => selectPluralForm("ja-JP", n))).toEqual(["other", "other"]); + }); + + it("leave the templates pack with Forgejo's wording", () => { + expect(forgejoWordingTemplate.replace(/\{\{\/\*.*?\*\/\}\}/s, "").trim()).toBe("{{.Fallback -}}"); + }); + + it("compile into one template with every language and the fallback", () => { + const template = buildPhraseTemplate(phrases); + for (const language of Object.keys(phrases)) expect(template).toContain(`eq $lang "${language}"`); + expect(template).toContain("{{.Fallback}}"); + // Text is quoted, so the template escapes it. + expect(template).not.toMatch(/\}\}[^{\n]*<[a-z]/i); + }); +}); diff --git a/scripts/phrases.ts b/scripts/phrases.ts new file mode 100644 index 00000000..cae86424 --- /dev/null +++ b/scripts/phrases.ts @@ -0,0 +1,233 @@ +import { readFileSync, readdirSync } from "node:fs"; +import { join } from "node:path"; + +/** + * The theme's own phrases: GitHub's wording where Forgejo has no translation of its own, as an optional add-on. + * + * Forgejo reads a custom locale file instead of its own one, never on top of it, so the theme cannot add keys to + * Forgejo's translations without replacing them and an admin's custom ones. The phrases live in `locales/` instead, + * one JSON file per language, and the build compiles them into the template `theme/phrase` of the add-on archive. A + * template asks it for a phrase with a fallback, which is Forgejo's own text: the templates pack prints only the + * fallback, and with the add-on a reader whose language has no theme phrase still gets it. + */ + +/** A phrase: a plain string, or one string per plural form of the language. */ +export type Phrase = string | Partial>; +export type Phrases = Record; +export type PluralForm = "zero" | "one" | "two" | "few" | "many" | "other"; + +/** Forgejo's plural rules (modules/translation/plural_rules.go), with the forms each rule asks for. */ +type PluralRule = { forms: PluralForm[]; select: (n: number) => PluralForm; template: string }; + +// Each rule's template sets $form. Templates have no modulo, so the rules read n % 10 and n % 100 off the decimal +// digits as $m10 and $m100. +const pluralRules = { + default: { + forms: ["one", "other"], + select: n => (n === 1 ? "one" : "other"), + template: `{{if Eval $n "==" 1}}{{$form = "one"}}{{else}}{{$form = "other"}}{{end}}`, + }, + bengali: { + forms: ["one", "other"], + select: n => (n > 1 ? "other" : "one"), + template: `{{if Eval $n ">" 1}}{{$form = "other"}}{{else}}{{$form = "one"}}{{end}}`, + }, + filipino: { + forms: ["one", "other"], + select: n => (n !== 1 && n !== 2 && n !== 3 && [4, 6, 9].includes(n % 10) ? "other" : "one"), + template: `{{if Eval $n "!=" 1 "and" $n "!=" 2 "and" $n "!=" 3 "and" "(" $m10 "==" 4 "or" $m10 "==" 6 "or" $m10 "==" 9 ")"}}{{$form = "other"}}{{else}}{{$form = "one"}}{{end}}`, + }, + oneForm: { + forms: ["other"], + select: () => "other", + template: `{{$form = "other"}}`, + }, + czech: { + forms: ["one", "few", "other"], + select: n => (n === 1 ? "one" : n >= 2 && n <= 4 ? "few" : "other"), + template: `{{if Eval $n "==" 1}}{{$form = "one"}}{{else if Eval $n ">=" 2 "and" $n "<=" 4}}{{$form = "few"}}{{else}}{{$form = "other"}}{{end}}`, + }, + russian: { + forms: ["one", "few", "many"], + select: n => + n % 10 === 1 && n % 100 !== 11 + ? "one" + : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) + ? "few" + : "many", + template: `{{if Eval $m10 "==" 1 "and" $m100 "!=" 11}}{{$form = "one"}}{{else if Eval $m10 ">=" 2 "and" $m10 "<=" 4 "and" "(" $m100 "<" 10 "or" $m100 ">=" 20 ")"}}{{$form = "few"}}{{else}}{{$form = "many"}}{{end}}`, + }, + polish: { + forms: ["one", "few", "many"], + select: n => (n === 1 ? "one" : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? "few" : "many"), + template: `{{if Eval $n "==" 1}}{{$form = "one"}}{{else if Eval $m10 ">=" 2 "and" $m10 "<=" 4 "and" "(" $m100 "<" 10 "or" $m100 ">=" 20 ")"}}{{$form = "few"}}{{else}}{{$form = "many"}}{{end}}`, + }, + latvian: { + forms: ["zero", "one", "other"], + select: n => + n % 10 === 0 || (n % 100 >= 11 && n % 100 <= 19) ? "zero" : n % 10 === 1 && n % 100 !== 11 ? "one" : "other", + template: `{{if Eval $m10 "==" 0 "or" "(" $m100 ">=" 11 "and" $m100 "<=" 19 ")"}}{{$form = "zero"}}{{else if Eval $m10 "==" 1 "and" $m100 "!=" 11}}{{$form = "one"}}{{else}}{{$form = "other"}}{{end}}`, + }, + // Forgejo's French and Catalan rules also have a "many" form for multiples of a million, left out here. + french: { + forms: ["one", "other"], + select: n => (n === 0 || n === 1 ? "one" : "other"), + template: `{{if Eval $n "<=" 1}}{{$form = "one"}}{{else}}{{$form = "other"}}{{end}}`, + }, + catalan: { + forms: ["one", "other"], + select: n => (n === 1 ? "one" : "other"), + template: `{{if Eval $n "==" 1}}{{$form = "one"}}{{else}}{{$form = "other"}}{{end}}`, + }, + slovenian: { + forms: ["one", "two", "few", "other"], + select: n => (n % 100 === 1 ? "one" : n % 100 === 2 ? "two" : n % 100 === 3 || n % 100 === 4 ? "few" : "other"), + template: `{{if Eval $m100 "==" 1}}{{$form = "one"}}{{else if Eval $m100 "==" 2}}{{$form = "two"}}{{else if Eval $m100 "==" 3 "or" $m100 "==" 4}}{{$form = "few"}}{{else}}{{$form = "other"}}{{end}}`, + }, +} satisfies Record; + +/** The plural rule Forgejo uses for each of the languages it enables by default (modules/setting/i18n.go). */ +export const languageRules: Record = { + "en-US": "default", + "zh-CN": "oneForm", + "zh-HK": "oneForm", + "zh-TW": "oneForm", + da: "default", + "de-DE": "default", + nds: "default", + "fr-FR": "french", + "nl-NL": "default", + "lv-LV": "latvian", + "ru-RU": "russian", + "uk-UA": "russian", + "ja-JP": "oneForm", + "es-ES": "catalan", + "pt-BR": "french", + "pt-PT": "catalan", + "pl-PL": "polish", + bg: "default", + "it-IT": "catalan", + "fi-FI": "default", + fil: "filipino", + eo: "default", + "tr-TR": "default", + "cs-CZ": "czech", + sl: "slovenian", + "sv-SE": "default", + "ko-KR": "oneForm", + "el-GR": "default", + "fa-IR": "bengali", + "hu-HU": "default", + "id-ID": "oneForm", +}; + +export const pluralForms = (language: string): PluralForm[] => pluralRules[languageRules[language]].forms; +export const selectPluralForm = (language: string, n: number): PluralForm => + pluralRules[languageRules[language]].select(n); + +/** What the template puts in place of a phrase's placeholders: the dict's Count and Branch. */ +const placeholders: Record = { + count: "{{.Count}}", + branch: "{{.Branch}}", +}; + +/** + * {list}: the non-zero counts of a pull request's checks, each worded by its phrase with its own number, joined by the + * language's separator. A template cannot pass another template's output on, so the list is built in place. + */ +export const listItems = [ + ["pulls.checks.count_failing", "{{.Failing}}", ".Failing"], + ["pulls.checks.count_pending", "{{.Pending}}", ".Pending"], + ["pulls.checks.count_skipped", "{{.Skipped}}", ".Skipped"], + ["pulls.checks.count_successful", "{{.Successful}}", ".Successful"], +] as const; +export const listSeparator = "pulls.checks.list_separator"; + +const renderList = (language: string, entries: Phrases): string => { + const separator = entries[listSeparator]; + if (typeof separator !== "string") throw new Error(`${language} misses the string ${listSeparator}`); + const items = listItems.map(([key, value, field]) => { + const phrase = entries[key]; + if (typeof phrase !== "string") throw new Error(`${language} misses the string ${key}`); + return `{{if ${field}}}{{if $listed}}${renderText(separator)}{{end}}{{$listed = true}}${renderText(phrase, { count: value })}{{end}}`; + }); + return `{{$listed := false}}${items.join("")}`; +}; + +export const readPhrases = (directory: string): Record => + Object.fromEntries( + readdirSync(directory) + .filter(file => file.endsWith(".json")) + .sort() + .map(file => [ + file.slice(0, -".json".length), + JSON.parse(readFileSync(join(directory, file), "utf-8")) as Phrases, + ]) + ); + +export const placeholdersOf = (text: string): string[] => + [...text.matchAll(/\{(\w+)\}/g)].map(match => match[1]).sort(); + +// Text goes in as quoted strings, which the template escapes and its whitespace trimming leaves alone; a placeholder +// becomes its own action, so a branch passed as HTML stays HTML. +const renderText = (text: string, values: Record = placeholders): string => + text + .split(/(\{\w+\})/) + .filter(part => part !== "") + .map(part => { + const name = /^\{(\w+)\}$/.exec(part)?.[1]; + if (name === undefined) return `{{${JSON.stringify(part)}}}`; + const value = values[name]; + if (!value) throw new Error(`Unknown placeholder {${name}} in "${text}"`); + return value; + }) + .join(""); + +const renderPhrase = (language: string, entries: Phrases, phrase: Phrase): string => { + const values = { ...placeholders, list: renderList(language, entries) }; + if (typeof phrase === "string") return renderText(phrase, values); + const rule = pluralRules[languageRules[language]]; + const branches = rule.forms.map((form, index) => { + const text = phrase[form]; + if (text === undefined) throw new Error(`${language} misses the "${form}" form`); + return `${index === 0 ? "{{if" : "{{else if"} eq $form "${form}"}}${renderText(text, values)}`; + }); + return `{{$form := ""}}${rule.template}${branches.join("")}{{end}}`; +}; + +/** + * The template `theme/phrase` in the templates pack: Forgejo's wording only. The optional GitHub wording add-on + * replaces it with the template that buildPhraseTemplate compiles. + */ +export const forgejoWordingTemplate = + "{{/* Forgejo's wording. Extract theme-github-wording.tar.gz over the templates for GitHub's. */}}{{.Fallback -}}\n"; + +/** + * Builds the template `theme/phrase`. It takes a dict with Key, Fallback and, as the phrase needs them, Count (which + * also picks the plural form), Branch, and for {list} Failing, Pending, Skipped and Successful. It prints the reader's + * phrase or, for a language without theme phrases, the fallback. + */ +export const buildPhraseTemplate = (phrases: Record): string => { + const lines = [ + "{{/* Generated by scripts/phrases.ts from locales/*.json. Do not edit. */}}", + "{{- $lang := ctx.Locale.Language -}}", + "{{- $found := false -}}", + // n % 10 and n % 100 for the plural rules, read off the count's digits. + "{{- $n := 0 -}}{{- if .Count -}}{{- $n = .Count -}}{{- end -}}", + "{{- $digits := print $n -}}{{- $length := len $digits -}}", + '{{- $m10 := slice $digits (Eval $length "-" 1) -}}', + '{{- $m100 := $digits -}}{{- if Eval $length ">=" 2 -}}{{- $m100 = slice $digits (Eval $length "-" 2) -}}{{- end -}}', + ]; + for (const [language, entries] of Object.entries(phrases)) { + if (!languageRules[language]) throw new Error(`No plural rule for ${language}`); + lines.push(`{{- if eq $lang "${language}" -}}`); + Object.entries(entries).forEach(([key, phrase], index) => { + lines.push( + `{{- ${index === 0 ? "if" : "else if"} eq .Key "${key}" -}}{{- $found = true -}}${renderPhrase(language, entries, phrase)}` + ); + }); + lines.push("{{- end -}}", "{{- end -}}"); + } + lines.push("{{- if not $found -}}{{.Fallback}}{{- end -}}"); + return lines.join("\n") + "\n"; +};