From 36f3897fe3350004efbbebc3b870a25de308aa95 Mon Sep 17 00:00:00 2001 From: Hugo Dahl Date: Sat, 10 Apr 2021 18:36:53 -0500 Subject: [PATCH] Make error messages platform agnostic Remove mentions of 'MicroPython' in error messages as they could lead to confusion in lesser-experienced users --- locale/circuitpython.pot | 33 +++++++++++++++------------------ py/compile.c | 2 +- supervisor/shared/safe_mode.c | 6 +++--- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 9148569ecd..ae056d666e 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -434,7 +434,7 @@ msgid "Attempt to allocate %d blocks" msgstr "" #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running." +msgid "Attempted heap allocation when VM not running." msgstr "" #: shared-bindings/wifi/Radio.c @@ -999,6 +999,10 @@ msgstr "" msgid "Failed to write internal flash." msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Fatal error." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "" @@ -1171,6 +1175,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +#: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Invalid %q pin" msgstr "" @@ -1386,14 +1391,6 @@ msgstr "" msgid "Messages limited to 8 bytes" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption." -msgstr "" - -#: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error." -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" @@ -1445,6 +1442,10 @@ msgstr "" msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "NLR jump failed. Likely memory corruption." +msgstr "" + #: ports/esp32s2/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "" @@ -1877,7 +1878,7 @@ msgstr "" msgid "Read-only filesystem" msgstr "" -#: shared-module/bitmaptools/__init__.c shared-module/displayio/Bitmap.c +#: shared-module/displayio/Bitmap.c msgid "Read-only object" msgstr "" @@ -1952,14 +1953,6 @@ msgstr "" msgid "Scan already in progess. Stop with stop_scan." msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "Selected CTS pin not valid" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "Selected RTS pin not valid" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Serializer in use" @@ -3193,6 +3186,10 @@ msgstr "" msgid "invalid cert" msgstr "" +#: py/compile.c +msgid "invalid decorator" +msgstr "" + #: extmod/uos_dupterm.c msgid "invalid dupterm index" msgstr "" diff --git a/py/compile.c b/py/compile.c index 4a9fdc7db8..7971690d6d 100644 --- a/py/compile.c +++ b/py/compile.c @@ -768,7 +768,7 @@ STATIC bool compile_built_in_decorator(compiler_t *comp, int name_len, mp_parse_ } if (name_len != 2) { - compile_syntax_error(comp, name_nodes[0], translate("invalid micropython decorator")); + compile_syntax_error(comp, name_nodes[0], translate("invalid decorator")); return true; } diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index e8778216a6..184d3658a8 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -170,13 +170,13 @@ void print_safe_mode_message(safe_mode_t reason) { serial_write_compressed(translate("Crash into the HardFault_Handler.")); return; case MICROPY_NLR_JUMP_FAIL: - serial_write_compressed(translate("MicroPython NLR jump failed. Likely memory corruption.")); + serial_write_compressed(translate("NLR jump failed. Likely memory corruption.")); return; case MICROPY_FATAL_ERROR: - serial_write_compressed(translate("MicroPython fatal error.")); + serial_write_compressed(translate("Fatal error.")); break; case GC_ALLOC_OUTSIDE_VM: - serial_write_compressed(translate("Attempted heap allocation when MicroPython VM not running.")); + serial_write_compressed(translate("Attempted heap allocation when VM not running.")); break; #ifdef SOFTDEVICE_PRESENT // defined in ports/nrf/bluetooth/bluetooth_common.mk