diff --git a/appsettings/migrations/0025_vnc_console_and_nic_descriptions.py b/appsettings/migrations/0025_vnc_console_and_nic_descriptions.py new file mode 100644 index 00000000..c11291b6 --- /dev/null +++ b/appsettings/migrations/0025_vnc_console_and_nic_descriptions.py @@ -0,0 +1,29 @@ +from django.db import migrations +from django.utils.translation import gettext_noop as _ + +# what these settings do: the console ones apply to a VNC console only (a +# serial console has none of them), and a new VM's NIC model "default" is VirtIO +DESCRIPTIONS = { + "CONSOLE_SCALE": _("The VNC console starts scaled to its window"), + "CONSOLE_VIEW_ONLY": _("The VNC console starts view-only: no keyboard or mouse input"), + "CONSOLE_RESIZE_SESSION": _("The VNC console starts asking the guest to fit its screen to the window"), + "CONSOLE_CLIP_VIEWPORT": _("The VNC console starts clipped to its window, without scaling"), + "INSTANCE_NIC_DEFAULT_TYPE": _("Network card model chosen first for a new VM (default: VirtIO)"), +} + + +def describe(apps, schema_editor): + AppSettings = apps.get_model("appsettings", "AppSettings") + for setting in AppSettings.objects.using(schema_editor.connection.alias).filter(key__in=DESCRIPTIONS): + setting.description = DESCRIPTIONS[setting.key] + setting.save() + + +class Migration(migrations.Migration): + dependencies = [ + ("appsettings", "0024_log_retention_setting"), + ] + + operations = [ + migrations.RunPython(describe, migrations.RunPython.noop), + ] diff --git a/appsettings/tests/test_migrations.py b/appsettings/tests/test_migrations.py index 5669f3ca..514c707e 100644 --- a/appsettings/tests/test_migrations.py +++ b/appsettings/tests/test_migrations.py @@ -71,13 +71,15 @@ class ChoicesFixTestCase(TestCase): descriptions = importlib.import_module("appsettings.migrations.0021_setting_descriptions") +vnc_and_nic = importlib.import_module("appsettings.migrations.0025_vnc_console_and_nic_descriptions") class DescriptionsTestCase(TestCase): def test_every_setting_says_what_it_does_within_its_column(self): limit = AppSettings._meta.get_field("description").max_length removed = {"VIEW_INSTANCE_DETAIL_BOTTOM_BAR"} # by 0023 - for key, text in descriptions.DESCRIPTIONS.items(): + # as the last migration that describes a setting says + for key, text in {**descriptions.DESCRIPTIONS, **vnc_and_nic.DESCRIPTIONS}.items(): with self.subTest(key=key): self.assertLessEqual(len(text), limit) if key not in removed: diff --git a/locale/tr/LC_MESSAGES/django.mo b/locale/tr/LC_MESSAGES/django.mo index e87b97b0..2f6e8840 100644 Binary files a/locale/tr/LC_MESSAGES/django.mo and b/locale/tr/LC_MESSAGES/django.mo differ diff --git a/locale/tr/LC_MESSAGES/django.po b/locale/tr/LC_MESSAGES/django.po index 155fedb2..e7298bc1 100644 --- a/locale/tr/LC_MESSAGES/django.po +++ b/locale/tr/LC_MESSAGES/django.po @@ -1681,6 +1681,28 @@ msgstr "Log saklama süresi (gün)" msgid "Days the Logs page keeps its rows (1-3650)" msgstr "Logs sayfasının satırları sakladığı gün sayısı (1-3650)" +#: appsettings/migrations/0025_vnc_console_and_nic_descriptions.py:7 +msgid "The VNC console starts scaled to its window" +msgstr "VNC konsolu, penceresine ölçeklenmiş olarak açılır" + +#: appsettings/migrations/0025_vnc_console_and_nic_descriptions.py:8 +msgid "The VNC console starts view-only: no keyboard or mouse input" +msgstr "" +"VNC konsolu yalnızca görüntüleme modunda açılır: klavye ve fare girdisi yok" + +#: appsettings/migrations/0025_vnc_console_and_nic_descriptions.py:9 +msgid "The VNC console starts asking the guest to fit its screen to the window" +msgstr "VNC konsolu, konuktan ekranını pencereye uydurmasını isteyerek açılır" + +#: appsettings/migrations/0025_vnc_console_and_nic_descriptions.py:10 +msgid "The VNC console starts clipped to its window, without scaling" +msgstr "VNC konsolu, ölçeklenmeden penceresine kırpılmış olarak açılır" + +#: appsettings/migrations/0025_vnc_console_and_nic_descriptions.py:11 +msgid "Network card model chosen first for a new VM (default: VirtIO)" +msgstr "" +"Yeni bir sanal makine için önce seçilen ağ kartı modeli (default: VirtIO)" + #: appsettings/models.py:10 msgid "key" msgstr "anahtar" diff --git a/locale/zh/LC_MESSAGES/django.mo b/locale/zh/LC_MESSAGES/django.mo index fde75c31..45562bd7 100644 Binary files a/locale/zh/LC_MESSAGES/django.mo and b/locale/zh/LC_MESSAGES/django.mo differ diff --git a/locale/zh/LC_MESSAGES/django.po b/locale/zh/LC_MESSAGES/django.po index 5fe7a345..b78f57b9 100644 --- a/locale/zh/LC_MESSAGES/django.po +++ b/locale/zh/LC_MESSAGES/django.po @@ -1624,6 +1624,26 @@ msgstr "日志保留天数" msgid "Days the Logs page keeps its rows (1-3650)" msgstr "日志页面保留记录的天数(1-3650)" +#: appsettings/migrations/0025_vnc_console_and_nic_descriptions.py:7 +msgid "The VNC console starts scaled to its window" +msgstr "VNC 控制台启动时缩放到窗口大小" + +#: appsettings/migrations/0025_vnc_console_and_nic_descriptions.py:8 +msgid "The VNC console starts view-only: no keyboard or mouse input" +msgstr "VNC 控制台启动时为只读:不接受键盘和鼠标输入" + +#: appsettings/migrations/0025_vnc_console_and_nic_descriptions.py:9 +msgid "The VNC console starts asking the guest to fit its screen to the window" +msgstr "VNC 控制台启动时请求客户机将屏幕调整为窗口大小" + +#: appsettings/migrations/0025_vnc_console_and_nic_descriptions.py:10 +msgid "The VNC console starts clipped to its window, without scaling" +msgstr "VNC 控制台启动时裁剪到窗口大小,不缩放" + +#: appsettings/migrations/0025_vnc_console_and_nic_descriptions.py:11 +msgid "Network card model chosen first for a new VM (default: VirtIO)" +msgstr "新建虚拟机默认选择的网卡型号(默认:VirtIO)" + #: appsettings/models.py:10 msgid "key" msgstr "键"