1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 19:26:48 +00:00

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.
This commit is contained in:
catborise 2026-11-02 23:03:09 +03:00
parent 9f2cd664e6
commit 763f1525ca
9 changed files with 7202 additions and 4982 deletions

View file

@ -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

View file

@ -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

View file

@ -28,7 +28,7 @@ class AppSettingsTestCase(TestCase):
page = self.client.get(reverse("appsettings")).content.decode()
choice = page[page.index('<select id="language"'):]
choice = choice[:choice.index("</select>")]
self.assertEqual(re.findall(r'<option value="([^"]+)"', choice), ["en", "tr"])
self.assertEqual(re.findall(r'<option value="([^"]+)"', choice), ["en", "tr", "zh-hans"])
def test_appsettings_update_setting(self):
setting = AppSettings.objects.get(key="SHOW_ACCESS_ROOT_PASSWORD")

View file

@ -747,7 +747,7 @@
</fieldset>
<label class="form-label mt-3" for="{{ console_form.password.id_for_label }}">{{ console_form.password.label }}</label>
{{ console_form.password }}
<p class="small text-body-secondary mt-1 mb-0">{% trans "Up to 8 characters (an accented letter counts as two), used with \"Set a new one\"." %}</p>
<p class="small text-body-secondary mt-1 mb-0">{% trans 'Up to 8 characters (an accented letter counts as two), used with "Set a new one".' %}</p>
</div>
</section>
</div>

Binary file not shown.

View file

@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-11-02 19:48+0000\n"
"POT-Creation-Date: 2026-11-02 20:01+0000\n"
"PO-Revision-Date: 2020-11-04 12:00+0000\n"
"Last-Translator: catborise <muhammetalisag@gmail.com>, 2020\n"
"Language-Team: Turkish (https://www.transifex.com/catborise/teams/110663/"
@ -5110,9 +5110,12 @@ msgid "No password is set."
msgstr "Parola ayarlanmamış."
#: instances/templates/instances/settings_tab.html:750
msgid "Up to 8 characters (an accented letter counts as two), used with \\"
msgid ""
"Up to 8 characters (an accented letter counts as two), used with \"Set a new "
"one\"."
msgstr ""
"En fazla 8 karakter (aksanlı bir harf iki sayılır), şununla kullanılır: \\"
"En fazla 8 karakter (aksanlı bir harf iki sayılır), \"Yenisini belirle\" ile "
"kullanılır."
#: instances/templates/instances/settings_tab.html:757
msgid "Save console settings"
@ -8543,10 +8546,10 @@ msgstr "Kablosuz"
msgid "Vendor specific"
msgstr "Üreticiye özgü"
#: webvirtcloud/settings.py:319
#: webvirtcloud/settings.py:325
msgid "Localhost"
msgstr "Yerel sunucu"
#: webvirtcloud/settings.py:320
#: webvirtcloud/settings.py:326
msgid "All interfaces"
msgstr "Tüm arabirimler"

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -205,6 +205,7 @@ LANGUAGE_CODE = "en-us"
LANGUAGES = [
("en", "English"),
("tr", "Türkçe"),
("zh-hans", "简体中文"),
]
TIME_ZONE = "UTC"