Files
bookorbit/.github/workflows/crowdin-branch-cleanup.yml
T
neon a0bc01ea50 fix(client): remove Hungarian and Korean locales
Both catalogs held nothing but English fallback values, so selecting either language produced a
fully English interface that reads as broken rather than untranslated. Crowdin Translate covers only
24 languages and includes neither, so neither locale had any machine translation route, and no human
translations existed yet.

Drop them from the shared locale list, the Crowdin export configuration, the pull request allowlist,
the catalogs, and the tests, leaving fifteen target languages. Remove both from the Crowdin project
as well, after confirming each export was byte-identical to the English source so no translation work
was discarded.

Re-adding either is cheap once a translation route exists, whether that is a machine translation
engine that supports them or a volunteer translator.

Give the locale tests the same fallback semantics the application runs with. Production always loads
the English catalog and points `fallbackLocale` at it, so a key a target catalog does not carry
renders English. The test instances omitted both, which resolves a missing key to its own name, and
several assertions compared a translated label against the English one without checking that the
language actually translates that key. Both patterns pass only while every catalog is complete, and
would fail confusingly the first time a language lags behind a new key.

Delete the Crowdin service branch automatically once its pull request closes or merges. Crowdin
appends every export to the same branch and never rebases it, so a branch that outlives its pull
request keeps its original merge base and each later export diverges further from main until every
catalog conflicts. Deleting it forces Crowdin to recreate the branch from the current main.

Ref #576
2026-07-31 22:49:41 +00:00

34 lines
1.3 KiB
YAML

name: Crowdin Branch Cleanup
on:
pull_request:
types: [closed]
permissions:
contents: write
jobs:
delete-service-branch:
# Crowdin appends every export to the same service branch and never rebases it.
# A branch that outlives its pull request keeps its original merge base, so each
# later export diverges further from main and eventually conflicts on every
# catalog. Deleting it forces Crowdin to recreate it from the current main.
# This runs on close as well as merge, because Crowdin reuses the branch either way.
if: github.event.pull_request.head.ref == 'l10n_main' && github.event.pull_request.head.repo.full_name == github.repository
name: Delete l10n_main
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Delete the Crowdin service branch
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: l10n_main
run: |
if gh api "repos/$REPO/git/refs/heads/$BRANCH" >/dev/null 2>&1; then
gh api -X DELETE "repos/$REPO/git/refs/heads/$BRANCH"
echo "Deleted $BRANCH; Crowdin will recreate it from main on the next export."
else
echo "$BRANCH is already absent; nothing to delete."
fi