translations fixed

This commit is contained in:
ARvind Tiwari 2017-07-29 18:19:10 +05:30
parent 925252f1c9
commit c4ee89f6b8
4 changed files with 1529 additions and 213 deletions

View file

@ -13,7 +13,6 @@ def generate_ssh_key_name():
return 'dcl-generated-key-' + datetime.datetime.now().strftime('%m%d%y%H%M')
class HostingUserLoginForm(forms.Form):
email = forms.CharField(widget=forms.EmailInput())
@ -27,9 +26,11 @@ class HostingUserLoginForm(forms.Form):
password = self.cleaned_data.get('password')
is_auth = authenticate(email=email, password=password)
if not is_auth:
raise forms.ValidationError("Your username and/or password were incorrect.")
raise forms.ValidationError(
"Your username and/or password were incorrect.")
elif is_auth.validated == 0:
raise forms.ValidationError(_("Your account is not activated yet."))
raise forms.ValidationError(
_("Your account is not activated yet."))
return self.cleaned_data
def clean_email(self):
@ -66,13 +67,13 @@ class HostingUserSignupForm(forms.ModelForm):
class UserHostingKeyForm(forms.ModelForm):
private_key = forms.CharField(widget=forms.HiddenInput(), required=False)
public_key = forms.CharField(widget=forms.Textarea(
attrs={'class': 'form_public_key', 'placeholder': 'Paste here your public key'}),
attrs={'class': 'form_public_key', 'placeholder': _('Paste here your public key')}),
required=False,
)
user = forms.models.ModelChoiceField(queryset=CustomUser.objects.all(),
required=False, widget=forms.HiddenInput())
name = forms.CharField(required=False, widget=forms.TextInput(
attrs={'class': 'form_key_name', 'placeholder': 'Give a name to your key'}))
attrs={'class': 'form_key_name', 'placeholder': _('Give a name to your key')}))
def __init__(self, *args, **kwargs):
self.request = kwargs.pop("request")

File diff suppressed because it is too large Load diff

View file

@ -7,7 +7,7 @@
<div class="col-md-12">
<div class="col-sm-12">
<h2><i class="fa fa-key" aria-hidden="true"></i>&nbsp;{% trans "SSH Key"%}</h2>
<h4>{% trans "Choose a key option in order to access your VMs." %}</h4>
<h4>{% trans "Choose a key option in order to access your VM" %}.</h4>
{% if messages %}
<div class="alert alert-warning">
{% for message in messages %}
@ -17,7 +17,7 @@
{% endif %}
<div class="choice-container">
<div class="left-choice-container">
<h3>{% trans "I want to generate a new key pair"%}</h3>
<h3>{% trans "I want to generate a new key pair" %}.</h3>
<form action="#" method="post">
{% csrf_token %}
<button type="submit" class="btn btn-success choice-button generate-btn">

View file

@ -21,13 +21,13 @@
{% endfor %}
{% buttons %}
<div class="underform-contaner">
<h4>{% trans "Use your created key to access to the machine." %}</h4>
<h4>{% trans "Use your created key to access to the VM" %}.</h4>
<button type="submit" name='add_ssh' class="btn btn-success custom_form_button">
{% trans "Add SSH key"%}
</button>
</div>
<div class="underform-contaner">
<h4>{% trans "Or you can generate a new key pair."%}</h4>
<h4>{% trans "Or you can generate a new key pair"%}.</h4>
<button type="submit" name='generate' class="btn btn-default custom_form_button">{% trans "Generate"%}
</button>
</div>
@ -39,7 +39,7 @@
{% if private_key %}
<div class="alert alert-warning">
<strong>{% trans "Warning!"%}</strong>{% trans "You can download your SSH private key once. Don't lost your key"%}
<strong>{% trans "Warning!"%}</strong>{% trans "You can download your SSH private key once. Don't loose your key" %}
</div>
<div class="form-group">
<textarea class="form-control" rows="6" id="ssh_key" type="hidden" style="display:none">{{private_key}}</textarea>