Commit 999a46e0 by Kálmán Viktor

network: i18n for forms

parent 2bfa1d25
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
from django.forms import ModelForm from django.forms import ModelForm
from django.core.urlresolvers import reverse_lazy from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Div, Submit, BaseInput from crispy_forms.layout import Layout, Fieldset, Div, Submit, BaseInput
...@@ -56,8 +57,8 @@ class BlacklistItemForm(ModelForm): ...@@ -56,8 +57,8 @@ class BlacklistItemForm(ModelForm):
) )
), ),
FormActions( FormActions(
Submit('submit', 'Save changes'), Submit('submit', _('Save changes')),
LinkButton('back', 'Back', reverse_lazy('network.blacklist_list')) LinkButton('back', _("Back"), reverse_lazy('network.blacklist_list'))
) )
) )
...@@ -77,8 +78,8 @@ class DomainForm(ModelForm): ...@@ -77,8 +78,8 @@ class DomainForm(ModelForm):
), ),
), ),
FormActions( FormActions(
Submit('submit', 'Save'), Submit('submit', _('Save')),
LinkButton('back', 'Back', reverse_lazy('network.domain_list')) LinkButton('back', _("Back"), reverse_lazy('network.domain_list'))
) )
) )
...@@ -91,15 +92,15 @@ class GroupForm(ModelForm): ...@@ -91,15 +92,15 @@ class GroupForm(ModelForm):
helper.layout = Layout( helper.layout = Layout(
Div( Div(
Fieldset( Fieldset(
'Identity', '',
'name', 'name',
'description', 'description',
'owner', 'owner',
), ),
), ),
FormActions( FormActions(
Submit('submit', 'Save'), Submit('submit', _('Save')),
LinkButton('back', 'Back', reverse_lazy('network.group_list')) LinkButton('back', _("Back"), reverse_lazy('network.group_list'))
) )
) )
...@@ -112,13 +113,13 @@ class HostForm(ModelForm): ...@@ -112,13 +113,13 @@ class HostForm(ModelForm):
helper.layout = Layout( helper.layout = Layout(
Div( Div(
Fieldset( Fieldset(
'Identity', '',
'hostname', 'hostname',
'reverse', 'reverse',
'mac', 'mac',
), ),
Fieldset( Fieldset(
'Network', _('Network'),
'vlan', 'vlan',
'ipv4', 'ipv4',
'ipv6', 'ipv6',
...@@ -126,7 +127,7 @@ class HostForm(ModelForm): ...@@ -126,7 +127,7 @@ class HostForm(ModelForm):
'external_ipv4', 'external_ipv4',
), ),
Fieldset( Fieldset(
'Information', _('Information'),
'description', 'description',
'location', 'location',
'comment', 'comment',
...@@ -134,8 +135,8 @@ class HostForm(ModelForm): ...@@ -134,8 +135,8 @@ class HostForm(ModelForm):
), ),
), ),
FormActions( FormActions(
Submit('submit', 'Save'), Submit('submit', _('Save')),
LinkButton('back', 'Back', reverse_lazy('network.host_list'))) LinkButton('back', _('Back'), reverse_lazy('network.host_list')))
) )
class Meta: class Meta:
...@@ -159,8 +160,8 @@ class RecordForm(ModelForm): ...@@ -159,8 +160,8 @@ class RecordForm(ModelForm):
) )
), ),
FormActions( FormActions(
Submit('submit', 'Save'), Submit('submit', _("Save")),
LinkButton('back', 'Back', reverse_lazy('network.record_list')) LinkButton('back', _("Back"), reverse_lazy('network.record_list'))
) )
) )
...@@ -173,7 +174,7 @@ class RuleForm(ModelForm): ...@@ -173,7 +174,7 @@ class RuleForm(ModelForm):
helper.layout = Layout( helper.layout = Layout(
Div( Div(
Fieldset( Fieldset(
'Identity', '',
'direction', 'direction',
'description', 'description',
'foreign_network', 'foreign_network',
...@@ -189,7 +190,7 @@ class RuleForm(ModelForm): ...@@ -189,7 +190,7 @@ class RuleForm(ModelForm):
'nat_external_ipv4', 'nat_external_ipv4',
), ),
Fieldset( Fieldset(
'External', _('External'),
'vlan', 'vlan',
'vlangroup', 'vlangroup',
'host', 'host',
...@@ -198,8 +199,8 @@ class RuleForm(ModelForm): ...@@ -198,8 +199,8 @@ class RuleForm(ModelForm):
) )
), ),
FormActions( FormActions(
Submit('submit', 'Save'), Submit('submit', _("Save")),
LinkButton('back', 'Back', reverse_lazy('network.rule_list')) LinkButton('back', _("Back"), reverse_lazy('network.rule_list'))
) )
) )
...@@ -219,8 +220,8 @@ class SwitchPortForm(ModelForm): ...@@ -219,8 +220,8 @@ class SwitchPortForm(ModelForm):
) )
), ),
FormActions( FormActions(
Submit('submit', 'Save'), Submit('submit', _("Save")),
LinkButton('back', 'Back', LinkButton('back', _("Back"),
reverse_lazy('network.switch_port_list')) reverse_lazy('network.switch_port_list'))
) )
) )
...@@ -234,32 +235,32 @@ class VlanForm(ModelForm): ...@@ -234,32 +235,32 @@ class VlanForm(ModelForm):
helper.layout = Layout( helper.layout = Layout(
Div( Div(
Fieldset( Fieldset(
'Identity', '',
'name', 'name',
'vid', 'vid',
'network_type', 'network_type',
'managed', 'managed',
), ),
Fieldset( Fieldset(
'IPv4', _('IPv4'),
'network4', 'network4',
'snat_to', 'snat_to',
'snat_ip', 'snat_ip',
'dhcp_pool', 'dhcp_pool',
), ),
Fieldset( Fieldset(
'IPv6', _('IPv6'),
'network6', 'network6',
'ipv6_template', 'ipv6_template',
'host_ipv6_prefixlen', 'host_ipv6_prefixlen',
), ),
Fieldset( Fieldset(
'Domain name service', _('Domain name service'),
'domain', 'domain',
'reverse_domain', 'reverse_domain',
), ),
Fieldset( Fieldset(
'Info', _('Info'),
'description', 'description',
'comment', 'comment',
'owner', 'owner',
...@@ -268,8 +269,8 @@ class VlanForm(ModelForm): ...@@ -268,8 +269,8 @@ class VlanForm(ModelForm):
), ),
), ),
FormActions( FormActions(
Submit('submit', 'Save'), Submit('submit', _("Save")),
LinkButton('back', 'Back', reverse_lazy('network.vlan_list')) LinkButton('back', _("Back"), reverse_lazy('network.vlan_list'))
) )
) )
...@@ -290,8 +291,8 @@ class VlanGroupForm(ModelForm): ...@@ -290,8 +291,8 @@ class VlanGroupForm(ModelForm):
) )
), ),
FormActions( FormActions(
Submit('submit', 'Save'), Submit('submit', _("Save")),
LinkButton('back', 'Back', reverse_lazy( LinkButton('back', _("Back"), reverse_lazy(
'network.vlan_group_list')) 'network.vlan_group_list'))
) )
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment