From 1407af72913d891eefe884ff65f42f6b55aa2a14 Mon Sep 17 00:00:00 2001 From: Hugo Dahl Date: Wed, 30 Dec 2020 17:47:35 -0600 Subject: [PATCH 1/5] Add localization for built-in help Support localizing the output of a call to to match the firmware's language. --- locale/circuitpython.pot | 10 +++++++++- py/builtinhelp.c | 13 +++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3edadd57c7..770a61e8b5 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-30 17:42-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -44,6 +44,10 @@ msgstr "" msgid " File \"%q\", line %d" msgstr "" +#: py/builtinhelp.c +msgid " is of type %q\n" +msgstr "" + #: main.c msgid " output:\n" msgstr "" @@ -3193,6 +3197,10 @@ msgstr "" msgid "number of points must be at least 2" msgstr "" +#: py/builtinhelp.c +msgid "object " +msgstr "" + #: py/obj.c msgid "object '%q' is not a tuple or list" msgstr "" diff --git a/py/builtinhelp.c b/py/builtinhelp.c index d12e088d60..e1dcb60962 100644 --- a/py/builtinhelp.c +++ b/py/builtinhelp.c @@ -152,9 +152,18 @@ STATIC void mp_help_print_obj(const mp_obj_t obj) { mp_obj_type_t *type = mp_obj_get_type(obj); // try to print something sensible about the given object - mp_print_str(MP_PYTHON_PRINTER, "object "); + const compressed_string_t* compressed = translate("object "); + char decompressed_object[decompress_length(compressed)]; + decompress(compressed, decompressed_object); + + mp_print_str(MP_PYTHON_PRINTER, decompressed_object); mp_obj_print(obj, PRINT_STR); - mp_printf(MP_PYTHON_PRINTER, " is of type %q\n", type->name); + + compressed = translate(" is of type %q\n"); + char decompressed_typestring[decompress_length(compressed)]; + decompress(compressed, decompressed_typestring); + + mp_printf(MP_PYTHON_PRINTER, decompressed_typestring, type->name); mp_map_t *map = NULL; if (type == &mp_type_module) { From 5949516ece3e41caf0d155bb1f4ea3f19a591dfc Mon Sep 17 00:00:00 2001 From: Hugo Dahl Date: Mon, 11 Jan 2021 20:46:02 -0600 Subject: [PATCH 2/5] Update circuitpython.pot Fix missing closing quote --- locale/circuitpython.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index c74bab8234..130cd59032 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-12-30 17:42-0600\n" -"PO-Revision-Date: 2021-01-11 19:30-0600\n +"PO-Revision-Date: 2021-01-11 19:30-0600\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" From 87849fb62cb06547c98c1fd17bf08914cfaa79f4 Mon Sep 17 00:00:00 2001 From: Hugo Dahl Date: Tue, 12 Jan 2021 07:31:56 -0600 Subject: [PATCH 3/5] Fix pre-commit hook issue --- locale/circuitpython.pot | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 130cd59032..307d23f0e5 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,8 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-30 17:42-0600\n" -"PO-Revision-Date: 2021-01-11 19:30-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" From ea9fe249713583989a510ea4489d74da07b949c5 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 21 Jan 2021 18:02:35 -0500 Subject: [PATCH 4/5] shrink arduino_mkrzero build --- ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk index 7eb83a1230..20307fc051 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk @@ -11,3 +11,5 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 +SUPEROPT_VM = 0 +CFLAGS_INLINE_LIMIT = 40 From 63b5e56c721421d311e2b29da94ff0bd4e300e7a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 21 Jan 2021 23:49:49 -0500 Subject: [PATCH 5/5] shrink feather_m0_adalogger and gemma_m0 --- ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk | 1 + ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk | 1 + 2 files changed, 2 insertions(+) diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk index 143910318d..ab6c4ed99d 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk @@ -11,3 +11,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 +SUPEROPT_VM = 0 diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index 0345417a98..e1c0f4b9a7 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -20,4 +20,5 @@ endif ifeq ($(TRANSLATION), de_DE) RELEASE_NEEDS_CLEAN_BUILD = 1 CFLAGS_INLINE_LIMIT = 35 +SUPEROPT_VM = 0 endif