Make some i18n for trans text
Add some i18n for trans text, include python/html/js files. Change-Id: I4dedfc385978896816945b0373ff41c5eaf63c7d Partial-Bug: #1610542
This commit is contained in:
parent
a968b69b9c
commit
b365322631
@ -186,7 +186,7 @@ class UpdatableFieldsForm(forms.Form):
|
|||||||
if hasattr(field, 'update'):
|
if hasattr(field, 'update'):
|
||||||
field.update(self.initial, form=self, request=request)
|
field.update(self.initial, form=self, request=request)
|
||||||
if not field.required:
|
if not field.required:
|
||||||
field.widget.attrs['placeholder'] = 'Optional'
|
field.widget.attrs['placeholder'] = _('Optional')
|
||||||
|
|
||||||
|
|
||||||
class ServiceConfigurationForm(UpdatableFieldsForm):
|
class ServiceConfigurationForm(UpdatableFieldsForm):
|
||||||
|
@ -48,11 +48,11 @@ $(function() {
|
|||||||
|
|
||||||
var $newEnvTr = $('<tr class="new_env">' +
|
var $newEnvTr = $('<tr class="new_env">' +
|
||||||
'<td id="input_create_env" class="normal_column row" colspan="2"></td>' +
|
'<td id="input_create_env" class="normal_column row" colspan="2"></td>' +
|
||||||
'<td class="normal_column">New</td>' +
|
'<td class="normal_column">' + gettext("New") + '</td>' +
|
||||||
'<td class="actions_column">' +
|
'<td class="actions_column">' +
|
||||||
'<div class="btn-group">' +
|
'<div class="btn-group">' +
|
||||||
'<button id="confirm_create_env" class="btn btn-primary">Create</button>' +
|
'<button id="confirm_create_env" class="btn btn-primary">' + gettext("Create") + '</button>' +
|
||||||
'<button id="cancel_create_env" class="btn btn-default">Cancel</button>' +
|
'<button id="cancel_create_env" class="btn btn-default">' + gettext("Cancel") + '</button>' +
|
||||||
'</div></td></tr>');
|
'</div></td></tr>');
|
||||||
$name.appendTo($newEnvTr.find('td#input_create_env'));
|
$name.appendTo($newEnvTr.find('td#input_create_env'));
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ $(function() {
|
|||||||
$newEnvTr.remove();
|
$newEnvTr.remove();
|
||||||
hideSpinner();
|
hideSpinner();
|
||||||
horizon.alert('error',
|
horizon.alert('error',
|
||||||
'There was an error submitting the form. Please try again.');
|
gettext("There was an error submitting the form. Please try again."));
|
||||||
},
|
},
|
||||||
success: function(data, status, xhr) {
|
success: function(data, status, xhr) {
|
||||||
if ( data === '' ) {
|
if ( data === '' ) {
|
||||||
|
@ -40,7 +40,7 @@ $(function() {
|
|||||||
var password = $this.closest(".form-field,.form-group").prev().find("input").val();
|
var password = $this.closest(".form-field,.form-group").prev().find("input").val();
|
||||||
var confirmPassword = $this.val();
|
var confirmPassword = $this.val();
|
||||||
var div = $this.closest(".form-field,.form-group");
|
var div = $this.closest(".form-field,.form-group");
|
||||||
mainCheck(div, password, confirmPassword, "Passwords do not match");
|
mainCheck(div, password, confirmPassword, gettext("Passwords do not match"));
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkStrengthRemoveErrIfMatches(event) {
|
function checkStrengthRemoveErrIfMatches(event) {
|
||||||
@ -51,29 +51,29 @@ $(function() {
|
|||||||
var confirmPassword = $('#' + confirmPassId).val();
|
var confirmPassword = $('#' + confirmPassId).val();
|
||||||
var div = $this.closest(".form-field,.form-group").next();
|
var div = $this.closest(".form-field,.form-group").next();
|
||||||
if (confirmPassword.length) {
|
if (confirmPassword.length) {
|
||||||
mainCheck(div, password, confirmPassword, "Passwords do not match");
|
mainCheck(div, password, confirmPassword, gettext("Passwords do not match"));
|
||||||
}
|
}
|
||||||
var text = "Your password should have at least";
|
var text = gettext("Your password should have at least");
|
||||||
var meetRequirements = true;
|
var meetRequirements = true;
|
||||||
if (password.length < 7) {
|
if (password.length < 7) {
|
||||||
text += " 7 characters";
|
text += gettext(" 7 characters");
|
||||||
meetRequirements = false;
|
meetRequirements = false;
|
||||||
}
|
}
|
||||||
if (password.match(/[A-Z]+/) === null) {
|
if (password.match(/[A-Z]+/) === null) {
|
||||||
text += " 1 capital letter";
|
text += gettext(" 1 capital letter");
|
||||||
meetRequirements = false;
|
meetRequirements = false;
|
||||||
}
|
}
|
||||||
if (password.match(/[a-z]+/) === null) {
|
if (password.match(/[a-z]+/) === null) {
|
||||||
text += " 1 non-capital letter";
|
text += gettext(" 1 non-capital letter");
|
||||||
meetRequirements = false;
|
meetRequirements = false;
|
||||||
}
|
}
|
||||||
if (password.match(/[0-9]+/) === null) {
|
if (password.match(/[0-9]+/) === null) {
|
||||||
text += " 1 digit";
|
text += gettext(" 1 digit");
|
||||||
meetRequirements = false;
|
meetRequirements = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (password.match(/[!@#$%^&*()_+|\/.,~?><:{}-]+/) === null) {
|
if (password.match(/[!@#$%^&*()_+|\/.,~?><:{}-]+/) === null) {
|
||||||
text += " 1 special character";
|
text += gettext(" 1 special character");
|
||||||
meetRequirements = false;
|
meetRequirements = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@
|
|||||||
<div class="form-group has-feedback">
|
<div class="form-group has-feedback">
|
||||||
<input class="form-control"
|
<input class="form-control"
|
||||||
value="{{ search }}" type="text"
|
value="{{ search }}" type="text"
|
||||||
name="search" placeholder="Filter">
|
name="search" placeholder="{% trans 'Filter' %}">
|
||||||
<span class="fa fa-search form-control-feedback search-icon"></span>
|
<span class="fa fa-search form-control-feedback search-icon"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
Loading…
Reference in New Issue
Block a user