mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-08 11:16:47 +00:00
feat(locale): the panel offers only the languages it is translated into
The language choice on the Settings page listed every language Django knows, 99 of them. Six catalogs (Czech under the wrong code, German, Spanish, French, Russian, Ukrainian) translated none of the panel's messages, so choosing one of them, like most of the others, showed English. The Turkish catalog lacked the four newest messages. The panel now offers English and Turkish (LANGUAGES). The empty catalogs and the English one, which has nothing to translate, are removed. Turkish translates every message again. CI checks that the offered catalogs translate every message and that their compiled files are up to date; the README says how to update them.
This commit is contained in:
parent
2d47f87dcb
commit
9f2cd664e6
20 changed files with 791 additions and 28791 deletions
16
.github/workflows/test.yml
vendored
16
.github/workflows/test.yml
vendored
|
|
@ -71,7 +71,8 @@ jobs:
|
|||
libldap2-dev \
|
||||
libsasl2-dev \
|
||||
pkg-config \
|
||||
gcc
|
||||
gcc \
|
||||
gettext
|
||||
|
||||
- name: Install Python Dependencies
|
||||
run: |
|
||||
|
|
@ -90,6 +91,19 @@ jobs:
|
|||
- name: Run Django Migrations
|
||||
run: python manage.py migrate --noinput
|
||||
|
||||
# Each catalog of LANGUAGES translates every message, and its compiled
|
||||
# .mo is the .po's: a changed text needs its translations
|
||||
- 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
|
||||
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
|
||||
cmp <(msgunfmt "$dir/django.mo") <(msgunfmt /tmp/django.mo) || { echo "::error file=$dir/django.mo::not compiled from django.po (compilemessages)"; exit 1; }
|
||||
done
|
||||
|
||||
# Includes the vrtManager tests; fails below the coverage floor in pyproject.toml
|
||||
- name: Run Test Suite
|
||||
run: |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue