Add localization for built-in help
Support localizing the output of a call to to match the firmware's language.
This commit is contained in:
parent
72cad49c69
commit
1407af7291
@ -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 <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\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 ""
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user