diff --git a/instances/forms.py b/instances/forms.py index a3ef884..58ed049 100644 --- a/instances/forms.py +++ b/instances/forms.py @@ -15,16 +15,17 @@ class FlavorForm(forms.ModelForm): class ConsoleForm(forms.Form): - type = forms.ChoiceField() - listen_on = forms.ChoiceField() - generate_password = forms.BooleanField(required=False) - clear_password = forms.BooleanField(required=False) + type = forms.ChoiceField(label=_("Type")) + listen_on = forms.ChoiceField(label=_("Listen on")) + generate_password = forms.BooleanField(label=_("Generate password"), required=False) + clear_password = forms.BooleanField(label=_("Clear password"), required=False) password = forms.CharField( + label=_("Password"), widget=forms.PasswordInput(render_value=True), required=False ) - clear_keymap = forms.BooleanField(required=False) - keymap = forms.ChoiceField(required=False) + clear_keymap = forms.BooleanField(label=_("Clear keymap"), required=False) + keymap = forms.ChoiceField(label=_("Keymap"), required=False) def __init__(self, *args, **kwargs): super(ConsoleForm, self).__init__(*args, **kwargs) @@ -32,12 +33,13 @@ class ConsoleForm(forms.Form): (c, c) for c in AppSettings.objects.get(key="QEMU_CONSOLE_DEFAULT_TYPE").choices_as_list() ) - keymap_choices = [("auto", "Auto")] + list((c, c) for c in QEMU_KEYMAPS) - self.fields["type"] = forms.ChoiceField(choices=type_choices) + keymap_choices = [("auto", _("Auto"))] + list((c, c) for c in QEMU_KEYMAPS) + self.fields["type"] = forms.ChoiceField(label=_("Type"), choices=type_choices) self.fields["listen_on"] = forms.ChoiceField( + label=_("Listen on"), choices=QEMU_CONSOLE_LISTENER_ADDRESSES ) - self.fields["keymap"] = forms.ChoiceField(choices=keymap_choices) + self.fields["keymap"] = forms.ChoiceField(label=_("Keymap"), choices=keymap_choices) class NewVMForm(forms.ModelForm): diff --git a/instances/templates/instances/settings_tab.html b/instances/templates/instances/settings_tab.html index 0ea78d4..5008a3d 100644 --- a/instances/templates/instances/settings_tab.html +++ b/instances/templates/instances/settings_tab.html @@ -265,15 +265,15 @@ data-trigger="focus" data-bs-toggle="popover" data-bs-html="true" - data-bs-content="Bus: {{ disk.bus }}
- Format: {{ disk.format }}
- Cache: {{ disk.cache }}
- Serial: {{ disk.serial }}
- Readonly: {{ disk.readonly }}
- Shareable: {{ disk.shareable }}
- IO Mode: {{ disk.io }}
- Discard: {{ disk.discard }}
- Detect Zeroes: {{ disk.detect_zeroes }}"> + data-bs-content="{% trans 'Bus' %}: {{ disk.bus }}
+ {% trans 'Format' %}: {{ disk.format }}
+ {% trans 'Cache' %}: {{ disk.cache }}
+ {% trans 'Serial' %}: {{ disk.serial }}
+ {% trans 'Readonly' %}: {{ disk.readonly }}
+ {% trans 'Shareable' %}: {{ disk.shareable }}
+ {% trans 'IO Mode' %}: {{ disk.io }}
+ {% trans 'Discard' %}: {{ disk.discard }}
+ {% trans 'Detect Zeroes' %}: {{ disk.detect_zeroes }}"> {% bs_icon 'info' %} {{ disk.dev }} diff --git a/webvirtcloud/settings.py.template b/webvirtcloud/settings.py.template index 560ea0f..de07701 100644 --- a/webvirtcloud/settings.py.template +++ b/webvirtcloud/settings.py.template @@ -6,6 +6,7 @@ Django settings for webvirtcloud project. import ldap import subprocess from django_auth_ldap.config import LDAPSearch, NestedActiveDirectoryGroupType +from django.utils.translation import gettext_lazy as _ from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. @@ -213,8 +214,8 @@ SOCKETIO_PUBLIC_PATH = "socket.io/" # List of console listen addresses QEMU_CONSOLE_LISTENER_ADDRESSES = ( - ("127.0.0.1", "Localhost"), - ("0.0.0.0", "All interfaces"), + ("127.0.0.1", _("Localhost")), + ("0.0.0.0", _("All interfaces")), ) # List taken from http://qemu.weilnetz.de/qemu-doc.html#sec_005finvocation