mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-16 17:46:59 +00:00
A script run that fails on an error the interpreter's core throws (an
unknown name, a property of null or undefined, a property that cannot
be defined, assigned or deleted, a value that is not a function or a
constructor) showed that error in English in the status bar. Seven of
these messages were built in a variable, so the untranslated-strings
report did not list them. Of the 23 complete-message catalogs, 17 had
no rows for the interpreter's messages, and the other six (de, it, pl,
pt-br, uk, zh-hans) had none for "invalid assignment target", the
reasons or the error types.
- Every complete-message catalog has rows for these errors, for the
reasons a property cannot be defined or assigned, for "invalid
assignment target", and for the error types (TypeError: {e} and the
others), so the failed-run line translates the message after the
type. Names, property names, null, undefined, 'in', 'instanceof' and
the type are kept, and e.message stays English for scripts. French
rows keep the no-break space before the colon.
- A value a message quotes in '...' is shown as written, like one in
"...", so a property named like a translated message keeps its name.
- An error about a property of null or undefined reached through a
computed key or a member assignment named an empty property
("cannot read property '' of null"). It now names a key that is not
an object and is at most 256 units long, and otherwise says "cannot
read a property of null" or "cannot set a property of undefined". An
increment (u['k']++) and a delete (delete null[true]) give the
"cannot read" form.
- The message scan reads the interpreter's .reject and .reject_bool
reasons.
Tests: i18n::tests::script_interpreter_core_errors_are_translated,
message_scan_reads_script_interpreter_errors,
interp_tests::errors_about_null_and_undefined_name_the_property.