1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00

feat(i18n): Ukrainian

The panel in Ukrainian, the language of the project's founder: a full
catalog of its 2610 messages, Ukrainian in the language list, and the CI
catalog check, the catalog test and CONTRIBUTING with locale/uk. Unit
symbols stay Latin (GiB, MiB/s), as the panel writes them in numbers
next to these texts.
This commit is contained in:
catborise 2026-11-25 07:39:29 +03:00
parent fe9ca0231d
commit f2b6be5fa8
8 changed files with 13459 additions and 8 deletions

View file

@ -91,8 +91,8 @@ jobs:
- name: Check Translation Catalogs
if: matrix.python-version == '3.12' && matrix.database == 'sqlite'
run: |
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
python manage.py makemessages -l tr -l zh -l uk --no-obsolete --ignore=staticfiles -v0
for dir in locale/tr/LC_MESSAGES locale/zh/LC_MESSAGES locale/uk/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

@ -61,9 +61,9 @@ It lists the dead keys it leaves out: a character only a dead key types cannot b
English is the source language; the panel is translated into the other 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 -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
python manage.py makemessages -l tr -l zh -l uk --no-obsolete --ignore=staticfiles --ignore=.venv
# translate the new and fuzzy entries of the django.po of locale/tr, locale/zh and locale/uk
python manage.py compilemessages -l tr -l zh -l uk
```
## Running tests

View file

@ -83,7 +83,7 @@ flowchart TB
<li>VMs created, renamed or deleted with <code>virsh</code> or <code>virt-manager</code> are picked up on their own</li>
<li>Tags, protected VMs, search by IP or MAC address and a VM report as an Excel file</li>
<li>Alerts by e-mail or webhook, and a health check URL</li>
<li>English, Turkish and Simplified Chinese</li>
<li>English, Turkish, Simplified Chinese and Ukrainian</li>
</ul>
</td>
</tr>

View file

@ -31,7 +31,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", "zh-hans"])
self.assertEqual(re.findall(r'<option value="([^"]+)"', choice), ["en", "tr", "zh-hans", "uk"])
def test_the_page_answers_in_the_users_language(self):
response = self.client.post(reverse("appsettings"), {}, HTTP_ACCEPT_LANGUAGE="tr", follow=True)

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -237,6 +237,7 @@ LANGUAGES = [
("en", "English"),
("tr", "Türkçe"),
("zh-hans", "简体中文"),
("uk", "Українська"),
]
# the installer writes the server's zone; Docker takes TZ (Django sets the process's TZ from this)

View file

@ -9,7 +9,7 @@ from django.conf import settings
from django.test import SimpleTestCase
from django.utils import translation
CATALOG_DIRS = {"tr": "tr", "zh-hans": "zh"}
CATALOG_DIRS = {"tr": "tr", "zh-hans": "zh", "uk": "uk"}
class CatalogTests(SimpleTestCase):