From 763f1525ca5c731d1ee12a80551bd9e718a2e262 Mon Sep 17 00:00:00 2001 From: catborise Date: Mon, 2 Nov 2026 23:03:09 +0300 Subject: [PATCH] feat(locale): the panel is translated into Simplified Chinese The Chinese catalog had not been extracted since 2023: of the panel's 1749 messages, 878 were missing and 455 carried old fuzzy guesses, and some of those marked done said something else ("Delete API token" read "Delete SSH key"). Every message is translated again, with one glossary for the panel's terms, placeholders and markup checked against the English, and the panel offers Simplified Chinese again. The CI check covers it too. One message of the VM page (the console password's help) never reached any catalog: its escaped quotes cut it short at extraction. It is written with single quotes now, and translated in both catalogs. --- .github/workflows/test.yml | 4 +- README.md | 6 +- appsettings/tests/test_appsettings.py | 2 +- .../templates/instances/settings_tab.html | 2 +- locale/tr/LC_MESSAGES/django.mo | Bin 158523 -> 158550 bytes locale/tr/LC_MESSAGES/django.po | 13 +- locale/zh/LC_MESSAGES/django.mo | Bin 76102 -> 148339 bytes locale/zh/LC_MESSAGES/django.po | 12156 +++++++++------- webvirtcloud/settings.py.template | 1 + 9 files changed, 7202 insertions(+), 4982 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7561dfbd..9cf3d98e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -96,8 +96,8 @@ jobs: - name: Check Translation Catalogs if: matrix.python-version == '3.12' && matrix.database == 'sqlite' run: | - python manage.py makemessages -l tr --no-obsolete --ignore=staticfiles -v0 - for dir in locale/tr/LC_MESSAGES; do + python manage.py makemessages -l tr -l zh --no-obsolete --ignore=staticfiles -v0 + for dir in locale/tr/LC_MESSAGES locale/zh/LC_MESSAGES; do msgfmt --check -o /tmp/django.mo "$dir/django.po" missing=$(msgattrib --untranslated "$dir/django.po"; msgattrib --only-fuzzy "$dir/django.po") if [ -n "$missing" ]; then echo "$missing"; echo "::error file=$dir/django.po::untranslated or fuzzy messages"; exit 1; fi diff --git a/README.md b/README.md index 1d56269f..80f9017d 100644 --- a/README.md +++ b/README.md @@ -741,9 +741,9 @@ It lists the dead keys it leaves out: a character only a dead key types cannot b The panel is translated into the languages of `LANGUAGES` in `settings.py`, each with a full catalog in `locale/`. A new or changed text needs its translation in each before CI passes (needs `gettext`): ```bash -python manage.py makemessages -l tr --no-obsolete --ignore=staticfiles --ignore=.venv -# translate the new and fuzzy entries of locale/tr/LC_MESSAGES/django.po -python manage.py compilemessages -l tr +python manage.py makemessages -l tr -l zh --no-obsolete --ignore=staticfiles --ignore=.venv +# translate the new and fuzzy entries of locale/tr/LC_MESSAGES/django.po and locale/zh/LC_MESSAGES/django.po +python manage.py compilemessages -l tr -l zh ``` ### Running tests diff --git a/appsettings/tests/test_appsettings.py b/appsettings/tests/test_appsettings.py index 61b7cae4..e70a5298 100644 --- a/appsettings/tests/test_appsettings.py +++ b/appsettings/tests/test_appsettings.py @@ -28,7 +28,7 @@ class AppSettingsTestCase(TestCase): page = self.client.get(reverse("appsettings")).content.decode() choice = page[page.index('