mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 17:36:05 +00:00
fix(i18n): form fields shown with their form's label are translated
A sweep of the panel in Turkish found English on screen where a field
had no label of its own: Django makes one from the field's name, and it
is not translated. A host's Hostname (TCP, TLS, socket forms), a new
user's Password, a new volume's Name and Format, and the VM owner form's
User and Instance showed in English, and so did the field names in the
error lists of a refused VM create form ("Hdd size: ...") and of the
new interface, network and pool dialogs ("Ipv4 addr: ..."). These fields
have the label the page shows elsewhere, and "qcow2 (recommended)" and
the navbar button's name are translated. A test checks that every field
these forms show has a label.
Left as they are: VM descriptions, log messages and libvirt's own words
are data; the XML editor's (Ace) screen-reader text is the library's.
This commit is contained in:
parent
7196871880
commit
85c727d397
15 changed files with 138 additions and 56 deletions
|
|
@ -6,31 +6,31 @@ from django.utils.translation import gettext_lazy as _
|
|||
|
||||
|
||||
class AddInterface(forms.Form):
|
||||
name = forms.CharField(max_length=15, required=True)
|
||||
name = forms.CharField(label=_("Name"), max_length=15, required=True)
|
||||
itype = forms.ChoiceField(
|
||||
required=True, choices=(("bridge", "bridge"), ("ethernet", "ethernet"))
|
||||
label=_("Type"), required=True, choices=(("bridge", "bridge"), ("ethernet", "ethernet"))
|
||||
)
|
||||
start_mode = forms.ChoiceField(
|
||||
required=True,
|
||||
label=_("Starts"), required=True,
|
||||
choices=(("none", "none"), ("onboot", "onboot"), ("hotplug", "hotplug")),
|
||||
)
|
||||
# a bridge's member; an ethernet interface configures the device in name
|
||||
netdev = forms.CharField(max_length=15, required=False)
|
||||
netdev = forms.CharField(label=_("Member device"), max_length=15, required=False)
|
||||
ipv4_type = forms.ChoiceField(
|
||||
required=True,
|
||||
label=_("IPv4"), required=True,
|
||||
choices=(("dhcp", "dhcp"), ("static", "static"), ("none", "none")),
|
||||
)
|
||||
# room for a dotted netmask: 192.0.2.10/255.255.255.0
|
||||
ipv4_addr = forms.CharField(max_length=31, required=False)
|
||||
ipv4_gw = forms.CharField(max_length=15, required=False)
|
||||
ipv4_addr = forms.CharField(label=_("IPv4 address"), max_length=31, required=False)
|
||||
ipv4_gw = forms.CharField(label=_("IPv4 gateway"), max_length=15, required=False)
|
||||
ipv6_type = forms.ChoiceField(
|
||||
required=True,
|
||||
label=_("IPv6"), required=True,
|
||||
choices=(("dhcp", "dhcp"), ("static", "static"), ("none", "none")),
|
||||
)
|
||||
ipv6_addr = forms.CharField(max_length=100, required=False)
|
||||
ipv6_gw = forms.CharField(max_length=100, required=False)
|
||||
stp = forms.ChoiceField(required=False, choices=(("on", "on"), ("off", "off")))
|
||||
delay = forms.IntegerField(required=False, min_value=0)
|
||||
ipv6_addr = forms.CharField(label=_("IPv6 address"), max_length=100, required=False)
|
||||
ipv6_gw = forms.CharField(label=_("IPv6 gateway"), max_length=100, required=False)
|
||||
stp = forms.ChoiceField(label=_("Spanning tree (STP)"), required=False, choices=(("on", "on"), ("off", "off")))
|
||||
delay = forms.IntegerField(label=_("Forward delay (s)"), required=False, min_value=0)
|
||||
|
||||
def __init__(self, *args, netdevs=(), members=(), defined=(), **kwargs):
|
||||
# The host's network devices. members: those a bridge can take
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue