From 50fa42181b9d95e3ddd4a7339a748105bf70f236 Mon Sep 17 00:00:00 2001 From: catborise Date: Sun, 22 Nov 2026 16:28:07 +0300 Subject: [PATCH] fix(ui): the settings index stays at hand on a phone; one wording in Turkish On a phone the settings page opened with its group index on seven lines, and the index was gone once the page, nine screens long, was scrolled. Below the lg breakpoint it is now one row that scrolls sideways and sticks under the navbar (navbar_height.js gives what sticks the navbar's height, which differs between themes and grows when the phone menu opens). Turkish said "VM" in 65 messages and "sanal makine" everywhere else; it now says "sanal makine" throughout. Headings and buttons that still capitalised every word follow the panel's sentence case, in English too (Change password, SSH keys, Power off, ...). Wrong translations fixed: a password that is set read as the command "Ayarla", the firmware setting was called a chip type, Create flavor said Create user, the console viewport setting was called a port, a DRBD typo, and host and interface are sunucu and arabirim as on every page. A group's save button reads "Kaydet: ". --- accounts/templates/account.html | 12 +- .../accounts/change_password_form.html | 4 +- accounts/templates/accounts/otp_login.html | 8 +- accounts/templates/accounts/otp_qr.html | 4 +- accounts/templates/login.html | 6 +- accounts/templates/profile.html | 8 +- accounts/tests/test_utils.py | 2 +- accounts/utils.py | 2 +- accounts/views.py | 6 +- admin/templates/admin/user_password_form.html | 4 +- admin/views.py | 8 +- appsettings/templates/appsettings.html | 25 +- computes/templates/computes/bulk_migrate.html | 4 +- computes/templates/computes/instances.html | 2 +- console/templates/console-menu.html | 6 +- instances/templates/create_instance_w2.html | 2 +- instances/templates/instances/info_tab.html | 12 +- instances/templates/instances/power_tab.html | 10 +- instances/tests/test_vm_report.py | 2 +- instances/views.py | 6 +- locale/tr/LC_MESSAGES/django.mo | Bin 268436 -> 268929 bytes locale/tr/LC_MESSAGES/django.po | 551 +++++++----------- locale/zh/LC_MESSAGES/django.mo | Bin 251417 -> 251018 bytes locale/zh/LC_MESSAGES/django.po | 105 ++-- static/js/navbar_height.js | 11 + storages/templates/create_stg_vol_block.html | 2 +- templates/base.html | 1 + templates/navbar.html | 2 +- 28 files changed, 325 insertions(+), 480 deletions(-) create mode 100644 static/js/navbar_height.js diff --git a/accounts/templates/account.html b/accounts/templates/account.html index e143e51d..e0e48bb4 100644 --- a/accounts/templates/account.html +++ b/accounts/templates/account.html @@ -3,8 +3,8 @@ {% load i18n %} {% load bootstrap_icons %} -{% block title %}{% trans "User Profile" %} - {{ user }}{% endblock %} -{% block page_heading %}{% trans "User Profile" %}{% endblock page_heading %} +{% block title %}{% trans "User profile" %} - {{ user }}{% endblock %} +{% block page_heading %}{% trans "User profile" %}{% endblock page_heading %} {% block content %}
@@ -54,8 +54,8 @@
@@ -99,12 +99,12 @@
-

{% trans "SSH Keys" %} {{ publickeys|length }}

+

{% trans "SSH keys" %} {{ publickeys|length }}

{% include "ssh_key_list.html" with owner=user %}
-

{% trans "API Tokens" %} {{ api_tokens|length }}

+

{% trans "API tokens" %} {{ api_tokens|length }}

{% include "api_token_list.html" with owner=user %}
{% endblock content %} diff --git a/accounts/templates/accounts/change_password_form.html b/accounts/templates/accounts/change_password_form.html index 6d3f2dae..f91d8802 100644 --- a/accounts/templates/accounts/change_password_form.html +++ b/accounts/templates/accounts/change_password_form.html @@ -2,9 +2,9 @@ {% load django_bootstrap5 %} {% load i18n %} -{% block title %}{% trans "Change Password" %}{% endblock title %} +{% block title %}{% trans "Change password" %}{% endblock title %} -{% block page_heading %}{% trans "Change Password" %}{% endblock page_heading %} +{% block page_heading %}{% trans "Change password" %}{% endblock page_heading %} {% block content %} {# a user changes their own password; one who must (a new or reset account) cannot go elsewhere first #} diff --git a/accounts/templates/accounts/otp_login.html b/accounts/templates/accounts/otp_login.html index d8e0c1f9..131e3149 100644 --- a/accounts/templates/accounts/otp_login.html +++ b/accounts/templates/accounts/otp_login.html @@ -2,7 +2,7 @@ {% load static %} {% load i18n %} -{% block title %}{% trans "WebVirtCloud" %} - {% trans "Sign In with OTP" %}{% endblock title %} +{% block title %}{% trans "WebVirtCloud" %} - {% trans "Sign in with OTP" %}{% endblock title %} {% block page_header %}{% endblock page_header %}{# the page has its own heading #} {% block content %} @@ -12,7 +12,7 @@
-

{% trans "Two-Factor Auth" %}

+

{% trans "Two-factor authentication" %}

{% trans "Enter your authentication code to continue" %}

@@ -54,7 +54,7 @@
- + {% trans "Lost OTP?" %}
@@ -66,7 +66,7 @@
diff --git a/accounts/templates/accounts/otp_qr.html b/accounts/templates/accounts/otp_qr.html index 2ce7af43..538800c9 100644 --- a/accounts/templates/accounts/otp_qr.html +++ b/accounts/templates/accounts/otp_qr.html @@ -1,9 +1,9 @@ {% extends "base.html" %} {% load i18n static %} -{% block title %}{% trans "OTP QR Code" %}{% endblock %} +{% block title %}{% trans "OTP QR code" %}{% endblock %} -{% block page_heading %}{% trans "OTP QR Code" %}{% endblock page_heading %} +{% block page_heading %}{% trans "OTP QR code" %}{% endblock page_heading %} {% block content %}
diff --git a/accounts/templates/login.html b/accounts/templates/login.html index 089e78f0..1aca143e 100644 --- a/accounts/templates/login.html +++ b/accounts/templates/login.html @@ -2,7 +2,7 @@ {% load static %} {% load i18n %} -{% block title %}{% trans "WebVirtCloud" %} - {% trans "Sign In" %}{% endblock title %} +{% block title %}{% trans "WebVirtCloud" %} - {% trans "Sign in" %}{% endblock title %} {% block page_header %}{% endblock page_header %}{# the page has its own heading #} {% block content %} @@ -13,7 +13,7 @@

WebVirtCloud

-

{% trans "Virtualization Management Console" %}

+

{% trans "Virtualization management console" %}

{% if app_settings.LOGIN_NOTICE %} @@ -56,7 +56,7 @@
diff --git a/accounts/templates/profile.html b/accounts/templates/profile.html index 22a58a33..dcf23106 100644 --- a/accounts/templates/profile.html +++ b/accounts/templates/profile.html @@ -32,7 +32,7 @@ {# an LDAP user's password is changed in LDAP #} {% if perms.accounts.change_password and user.has_usable_password %} {% endif %} @@ -41,9 +41,9 @@
-

{% trans "SSH Keys" %} {{ publickeys|length }}

+

{% trans "SSH keys" %} {{ publickeys|length }}

{% trans "Offered when you create a VM and on a VM's Access tab." %}
@@ -59,7 +59,7 @@
-

{% trans "API Tokens" %} {{ api_tokens|length }}

+

{% trans "API tokens" %} {{ api_tokens|length }}

diff --git a/accounts/tests/test_utils.py b/accounts/tests/test_utils.py index 8e34749e..12a0483f 100644 --- a/accounts/tests/test_utils.py +++ b/accounts/tests/test_utils.py @@ -108,7 +108,7 @@ class AccountsUtilsTestCase(TestCase): send_email_with_otp(RequestFactory().get("/"), device) self.assertEqual(len(mail.outbox), 1) message = mail.outbox[0] - self.assertEqual((message.subject, message.to, message.alternatives), ("OTP QR Code", ["user@example.com"], [])) + self.assertEqual((message.subject, message.to, message.alternatives), ("OTP QR code", ["user@example.com"], [])) self.assertNotIn(device.bin_key.hex(), message.body) self.assertNotIn("otpauth", message.body) # the token is the fragment, which no request (no access log) carries diff --git a/accounts/utils.py b/accounts/utils.py index fc0e08cf..8a4a1b6e 100644 --- a/accounts/utils.py +++ b/accounts/utils.py @@ -63,7 +63,7 @@ def send_email_with_otp(request, device): user = device.user url = request.build_absolute_uri(reverse("accounts:otp_qr")) + "#" + OTP_LINK.sign(str(device.pk)) send_mail( - _("OTP QR Code"), + _("OTP QR code"), _("Open this link within an hour to see the OTP QR code of account '%(user)s':\n\n%(url)s") % {"user": user, "url": url}, None, diff --git a/accounts/views.py b/accounts/views.py index a4b0bbc4..681e3d9f 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -237,7 +237,7 @@ def change_password(request): pass except OSError: logging.getLogger(__name__).warning("Could not remove the generated admin password file") - messages.success(request, _("Password Changed")) + messages.success(request, _("Password changed")) return redirect("accounts:profile") if form.has_error("old_password", "password_incorrect"): # someone at an open session guessing it failed(request, None, f"User {request.user.username}", "change password", "wrong old password") @@ -268,7 +268,7 @@ def user_instance_create(request, user_id): "common/form.html", { "form": form, - "title": _("Create User Instance"), + "title": _("Create user instance"), "searchable": True, }, ) @@ -303,7 +303,7 @@ def user_instance_update(request, pk): "common/form.html", { "form": form, - "title": _("Update User Instance"), + "title": _("Update user instance"), }, ) diff --git a/admin/templates/admin/user_password_form.html b/admin/templates/admin/user_password_form.html index d1c12b8f..1f58d58d 100644 --- a/admin/templates/admin/user_password_form.html +++ b/admin/templates/admin/user_password_form.html @@ -2,9 +2,9 @@ {% load django_bootstrap5 %} {% load i18n %} -{% block title %}{% trans "Change Password" %}{% endblock %} +{% block title %}{% trans "Change password" %}{% endblock %} -{% block page_heading %}{% trans "Change Password" %}{% endblock page_heading %} +{% block page_heading %}{% trans "Change password" %}{% endblock page_heading %} {% block content %} {# an administrator sets another user's password, or takes it away (sign-in by LDAP, for one) #} diff --git a/admin/views.py b/admin/views.py index ba559ada..29c9822f 100644 --- a/admin/views.py +++ b/admin/views.py @@ -77,7 +77,7 @@ def group_create(request): "admin/group_form.html", { "form": form, - "title": _("Create Group"), + "title": _("Create group"), }, ) @@ -119,7 +119,7 @@ def group_update(request, pk): "form": form, "group": group, "seen": form_seen(group_snapshot(group)), - "title": _("Update Group"), + "title": _("Update group"), }, ) @@ -219,7 +219,7 @@ def user_create(request): { "user_form": user_form, "attributes_form": attributes_form, - "title": _("Create User"), + "title": _("Create user"), }, ) @@ -293,7 +293,7 @@ def user_update(request, pk): "attributes_form": attributes_form, "edited_user": user, "seen": seen, - "title": _("Update User"), + "title": _("Update user"), }, ) diff --git a/appsettings/templates/appsettings.html b/appsettings/templates/appsettings.html index c64a7e6d..2eec4ff9 100644 --- a/appsettings/templates/appsettings.html +++ b/appsettings/templates/appsettings.html @@ -1,25 +1,40 @@ {% extends "base.html" %} {% load i18n %} -{% block title %}{% trans "Edit Settings" %}{% endblock title %} +{% block title %}{% trans "Edit settings" %}{% endblock title %} -{% block page_heading %}{% trans "Edit Settings" %}{% endblock page_heading %} +{% block page_heading %}{% trans "Edit settings" %}{% endblock page_heading %} {% block style %} {% endblock style %} {% block content %}
-
+