Merge "i18n: Avoid string concatenations to make translation life happier" into stable/newton

This commit is contained in:
Jenkins 2016-10-20 16:00:31 +00:00 committed by Gerrit Code Review
commit 875fe73c4d
3 changed files with 7 additions and 4 deletions

View File

@ -214,7 +214,8 @@
}
function loadFailed(reason) {
toastService.add('error', gettext("resource load failed: " + reason));
var msg = interpolate(gettext("resource load failed: %s"), [reason]);
toastService.add('error', msg);
}
}
}

View File

@ -90,8 +90,8 @@
$modalInstance.close(createdKeypair);
},
function error() {
var errorMessage = gettext('Unable to generate') + ' "' + ctrl.keypair + '". ' +
gettext('Please try again.');
var errorMessage = interpolate(gettext('Unable to generate "%s". Please try again.'),
[ctrl.keypair]);
toastService.add('error', errorMessage);
}
);

View File

@ -144,7 +144,9 @@
* @returns {undefined} No return value
*/
function notifyUserAndAssign(newKeypair) {
toastService.add('success', gettext('Created keypair: ' + newKeypair.name));
toastService.add('success',
interpolate(gettext('Created keypair: %s'),
[newKeypair.name]));
assignKeypair(newKeypair);
ctrl.createdKeypair = newKeypair;
ctrl.isKeypairCreated = true;