Mercurial > lada > lada-client
diff app/view/window/ImportResponse.js @ 1425:68e579063a47
Improve readability.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 06 Apr 2017 12:17:59 +0200 |
parents | ee21d0e1b998 |
children | 4de04242f7ce |
line wrap: on
line diff
--- a/app/view/window/ImportResponse.js Thu Apr 06 12:13:45 2017 +0200 +++ b/app/view/window/ImportResponse.js Thu Apr 06 12:17:59 2017 +0200 @@ -120,6 +120,7 @@ * @param data the payload of the response */ parseResponse: function(data) { + var i18n = Lada.getApplication().bundle; var errors = data.data.errors; var warnings = data.data.warnings; var out = []; @@ -165,13 +166,16 @@ if (msgs[i].key === 'validation') { validation.push('<ol>'); var parts = msgs[i].value.split('#'); - var str = Lada.getApplication().bundle.getMsg(parts[0]) + + var str = i18n.getMsg(parts[0]) + parts[1] === undefined ? '' : parts[1]; - validation.push(str + ' (' + Lada.getApplication().bundle.getMsg(msgs[i].code.toString()) + ')'); + validation.push(str + ' (' + + i18n.getMsg(msgs[i].code.toString()) + ')'); validation.push('</ol>'); } else { - out.push('<li>' + msgs[i].key + ' (' + Lada.getApplication().bundle.getMsg(msgs[i].code.toString())+'): '+msgs[i].value+'</li>') + out.push('<li>' + msgs[i].key + ' (' + + i18n.getMsg(msgs[i].code.toString()) + + '): ' + msgs[i].value + '</li>') } } if (validation.length > 1) { @@ -202,13 +206,16 @@ if (msgs[i].key === 'validation') { validation.push('<ol>'); var parts = msgs[i].value.split('#'); - var str = Lada.getApplication().bundle.getMsg(parts[0]) + + var str = i18n.getMsg(parts[0]) + parts[1] === undefined ? '' : parts[1]; - validation.push(str + ' (' + Lada.getApplication().bundle.getMsg(msgs[i].code.toString()) + ')'); + validation.push(str + ' (' + + i18n.getMsg(msgs[i].code.toString()) + ')'); validation.push('</ol>'); } else { - out.push('<li>' + msgs[i].key + ' (' + Lada.getApplication().bundle.getMsg(msgs[i].code.toString())+'): '+msgs[i].value+'</li>') + out.push('<li>' + msgs[i].key + ' (' + + i18n.getMsg(msgs[i].code.toString()) + + '): ' + msgs[i].value + '</li>') } } if (validation.length > 1) {