Merge pull request #3911 from hugodahl/add-translation-for-builtin-object-help

Update built-in help output for localization (Issue #3907)
This commit is contained in:
Dan Halbert 2021-01-22 03:49:19 -05:00 committed by GitHub
commit e3275be8b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 2 deletions

View File

@ -43,6 +43,10 @@ msgstr ""
msgid " File \"%q\", line %d"
msgstr ""
#: py/builtinhelp.c
msgid " is of type %q\n"
msgstr ""
#: main.c
msgid " output:\n"
msgstr ""
@ -3308,6 +3312,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 ""

View File

@ -11,3 +11,5 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
SUPEROPT_VM = 0
CFLAGS_INLINE_LIMIT = 40

View File

@ -11,3 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
SUPEROPT_VM = 0

View File

@ -20,4 +20,5 @@ endif
ifeq ($(TRANSLATION), de_DE)
RELEASE_NEEDS_CLEAN_BUILD = 1
CFLAGS_INLINE_LIMIT = 35
SUPEROPT_VM = 0
endif

View File

@ -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) {