Refactor installation to work out a few bugs and to make it cleaner. Transactions now reject on fail-responses, still need to update other places.

This commit is contained in:
Simo Kinnunen
2014-09-04 19:40:54 +09:00
parent f91bf901fa
commit c5a4727ae3
7 changed files with 159 additions and 233 deletions

View File

@@ -5,6 +5,19 @@ var responses = require('./response-codes.json')
module.exports = function installErrorFilter(gettext) {
return function (text) {
return gettext(responses[text] || text)
switch (text) {
case 'fail_invalid_app_file':
return gettext('Uploaded file is not valid.')
case 'fail_download':
return gettext('Failed to download specified URL.')
case 'fail_invalid_url':
return gettext('The specified URL is invalid.')
case 'fail':
return gettext('Upload failed to due unknown error.')
case 'timeout':
return gettext('Installation timed out.')
default:
return gettext(responses[text] || text)
}
}
}