localized data onversion error messages

snap7
Jens Mönig 2022-01-20 13:21:12 +01:00
rodzic f5279d74ed
commit 01e9a3581b
2 zmienionych plików z 22 dodań i 5 usunięć

Wyświetl plik

@ -1998,6 +1998,8 @@ SnapTranslator.dict.de = {
'Pr\u00e4dikat',
'sprite':
'Objekt',
'ring':
'Ring',
'nothing':
'nichts',
@ -2115,5 +2117,9 @@ SnapTranslator.dict.de = {
'Inside a custom block':
'In einem benutzerdefinierten Block',
'The error occured at':
'Der Fehler passierte bei'
'Der Fehler passierte bei',
'continuations cannot be forked':
'Continuations können nicht separat gestartet werden',
'unable to convert to':
'Kann die Liste nicht umwandeln in'
};

Wyświetl plik

@ -1457,7 +1457,12 @@ Process.prototype.initializeFor = function (context, args) {
);
}
if (!(context instanceof Context)) {
throw new Error('expecting a ring but getting ' + context);
throw new Error(
localize('expecting a') + ' ' +
localize('ring') + ' ' +
localize('but getting a') + ' ' +
localize(this.reportTypeOf(context))
);
}
var outer = new Context(null, null, context.outerContext),
@ -2096,19 +2101,25 @@ Process.prototype.reportListAttribute = function (choice, list) {
if (list.canBeTXT()) {
return list.asTXT();
}
throw new Error('unable to convert to lines');
throw new Error(
localize('unable to convert to') + ' ' + localize('lines')
);
case 'csv':
this.assertType(list, 'list');
if (list.canBeCSV()) {
return list.asCSV();
}
throw new Error('unable to convert to CSV');
throw new Error(
localize('unable to convert to') + ' ' + localize('CSV')
);
case 'json':
this.assertType(list, 'list');
if (list.canBeJSON()) {
return list.asJSON();
}
throw new Error('unable to convert to JSON');
throw new Error(
localize('unable to convert to') + ' ' + localize('JSON')
);
default:
return 0;
}