Skip to content

Commit

Permalink
Merge pull request #628 from kuletco/work
Browse files Browse the repository at this point in the history
fix bug and update translations for zh
  • Loading branch information
catborise committed Dec 13, 2023
2 parents d261f4d + 462e5d8 commit bbe9e54
Show file tree
Hide file tree
Showing 6 changed files with 1,123 additions and 1,304 deletions.
2 changes: 1 addition & 1 deletion computes/templates/computes/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h3 class="page-header">{% trans "Computes" %}</h3>
{% if not computes %}
<div class="col-lg-12">
<div class="alert alert-warning shadow-sm">
{% bs_icon 'exclamation-triangle '%} <strong>{% trans "Warning" %}:</strong> {% trans "You don't have any computes" %}
{% bs_icon 'exclamation-triangle'%} <strong>{% trans "Warning" %}:</strong> {% trans "You don't have any computes" %}
</div>
</div>
{% else %}
Expand Down
20 changes: 11 additions & 9 deletions instances/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,31 @@ class Meta:


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)
type_choices = (
(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):
Expand Down
18 changes: 9 additions & 9 deletions instances/templates/instances/settings_tab.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,15 @@
data-trigger="focus"
data-bs-toggle="popover"
data-bs-html="true"
data-bs-content="<strong>Bus:</strong> {{ disk.bus }} <br/>
<strong>Format:</strong> {{ disk.format }} <br/>
<strong>Cache:</strong> {{ disk.cache }} <br/>
<strong>Serial:</strong> {{ disk.serial }} <br/>
<strong>Readonly:</strong> {{ disk.readonly }} <br/>
<strong>Shareable:</strong> {{ disk.shareable }}</br>
<strong>IO Mode:</strong> {{ disk.io }} <br/>
<strong>Discard:</strong> {{ disk.discard }} <br/>
<strong>Detect Zeroes:</strong> {{ disk.detect_zeroes }}">
data-bs-content="<strong>{% trans 'Bus' %}:</strong> {{ disk.bus }} <br/>
<strong>{% trans 'Format' %}:</strong> {{ disk.format }} <br/>
<strong>{% trans 'Cache' %}:</strong> {{ disk.cache }} <br/>
<strong>{% trans 'Serial' %}:</strong> {{ disk.serial }} <br/>
<strong>{% trans 'Readonly' %}:</strong> {{ disk.readonly }} <br/>
<strong>{% trans 'Shareable' %}:</strong> {{ disk.shareable }}</br>
<strong>{% trans 'IO Mode' %}:</strong> {{ disk.io }} <br/>
<strong>{% trans 'Discard' %}:</strong> {{ disk.discard }} <br/>
<strong>{% trans 'Detect Zeroes' %}:</strong> {{ disk.detect_zeroes }}">
<span>{% bs_icon 'info' %} </span>
</button>
{{ disk.dev }}
Expand Down
Binary file modified locale/zh/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit bbe9e54

Please sign in to comment.