Skip to content

Commit

Permalink
Merge pull request #1900 from pgiraud/missing-translations
Browse files Browse the repository at this point in the history
Missing translations
  • Loading branch information
Pierre GIRAUD authored Sep 27, 2016
2 parents 94733a2 + 383b325 commit 9c33fac
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion contribs/gmf/apps/desktop/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
</button>
</p>
<p>
<em ng-if="ctrl.interaction.active" class="text-muted small">
<em translate ng-if="ctrl.interaction.active" class="text-muted small">
Draw a line on the map to display the corresponding elevation profile.
Use double-click to finish the drawing.
</em>
Expand Down
20 changes: 9 additions & 11 deletions contribs/gmf/src/directives/authenticationdirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,37 +174,36 @@ gmf.AuthenticationController.prototype.changePassword = function() {
var oldPwd = this.oldPwdVal;
var newPwd = this.newPwdVal;
var confPwd = this.newPwdConfVal;
var cat = this.gettextCatalog;

var errors = [];
// (1) validation - passwords are required
if (oldPwd === '') {
errors.push(cat.getString('The old password is required.'));
errors.push(this.gettextCatalog.getString('The old password is required.'));
}
if (newPwd === '') {
errors.push(cat.getString('The new password is required.'));
errors.push(this.gettextCatalog.getString('The new password is required.'));
}
if (confPwd === '') {
errors.push(cat.getString('The password confirmation is required.'));
errors.push(this.gettextCatalog.getString('The password confirmation is required.'));
}

if (errors.length) {
this.setError_(errors);
} else {
// (2) validation - passwords must be new and must also match
if (oldPwd === newPwd) {
errors.push(cat.getString('The old and new passwords are the same.'));
errors.push(this.gettextCatalog.getString('The old and new passwords are the same.'));
}
if (newPwd !== confPwd) {
errors.push(cat.getString('The passwords don\'t match.'));
errors.push(this.gettextCatalog.getString('The passwords don\'t match.'));
}

if (errors.length) {
this.setError_(errors);
} else {
// (3) send request with current credentials, which may fail if
// the old password given is incorrect.
var error = cat.getString('Incorrect old password.');
var error = this.gettextCatalog.getString('Incorrect old password.');
this.gmfAuthentication_.changePassword(oldPwd, newPwd, confPwd).then(
function() {
this.changePasswordModalShown = true;
Expand All @@ -221,18 +220,17 @@ gmf.AuthenticationController.prototype.changePassword = function() {
* @export
*/
gmf.AuthenticationController.prototype.login = function() {
var cat = this.gettextCatalog;
var errors = [];
if (this.loginVal === '') {
errors.push(cat.getString('The username is required.'));
errors.push(this.gettextCatalog.getString('The username is required.'));
}
if (this.pwdVal === '') {
errors.push(cat.getString('The password is required.'));
errors.push(this.gettextCatalog.getString('The password is required.'));
}
if (errors.length) {
this.setError_(errors);
} else {
var error = cat.getString('Incorrect username or password.');
var error = this.gettextCatalog.getString('Incorrect username or password.');
this.gmfAuthentication_.login(this.loginVal, this.pwdVal).then(
this.resetError_.bind(this),
this.setError_.bind(this, error));
Expand Down
2 changes: 1 addition & 1 deletion src/directives/createfeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ ngeo.CreatefeatureController = function(gettext, $compile, $filter, $scope,
helpMsg = gettext('Click to start drawing area');
contMsg = gettext(
'Click to continue drawing<br/>' +
'Double-click or click last starting point to finish'
'Double-click or click starting point to finish'
);

interaction = new ngeo.interaction.MeasureArea(
Expand Down
2 changes: 1 addition & 1 deletion src/directives/measurearea.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ngeo.measureareaDirective = function($compile, gettext, $filter) {

var helpMsg = gettext('Click to start drawing area');
var contMsg = gettext('Click to continue drawing<br/>' +
'Double-click or click last starting point to finish');
'Double-click or click starting point to finish');

var measureArea = new ngeo.interaction.MeasureArea($filter('ngeoUnitPrefix'), {
style: new ol.style.Style(),
Expand Down

0 comments on commit 9c33fac

Please sign in to comment.