circuitpython/supervisor
Jeff Epler e06a3bbceb translation: Compress as unicode, not bytes
By treating each unicode code-point as a single entity for huffman
compression, the overall compression rate can be somewhat improved
without changing the algorithm.  On the decompression side, when
compressed values above 127 are encountered, they need to be
converted from a 16-bit Unicode code point into a UTF-8 byte
sequence.

Doing this returns approximately 1.5kB of flash storage with the
zh_Latn_pinyin translation. (292 -> 1768 bytes remaining in my build
of trinket_m0)

Other "more ASCII" translations benefit less, and in fact
zh_Latn_pinyin is no longer the most constrained translation!
(de_DE 1156 -> 1384 bytes free in flash, I didn't check others
before pushing for CI)

English is slightly pessimized, 2840 -> 2788 bytes, probably mostly
because the "values" array was changed from uint8_t to uint16_t,
which is strictly not required for an all-ASCII translation.  This
could probably be avoided in this case, but as English is not the
most constrained translation it doesn't really matter.

Testing performed: built for feather nRF52840 express and trinket m0
in English and zh_Latn_pinyin; ran and verified the localized
messages such as
    Àn xià rènhé jiàn jìnrù REPL. Shǐyòng CTRL-D chóngxīn jiāzài.
and
    Press any key to enter the REPL. Use CTRL-D to reload.
were properly displayed.
2019-12-02 09:46:46 -06:00
..
messages Support internationalisation. 2018-08-07 14:58:57 -07:00
shared translation: Compress as unicode, not bytes 2019-12-02 09:46:46 -06:00
stub Remove unused static function 2019-09-06 11:06:02 -04:00
cpu.h Mark pointers in cpu registers as in use. 2018-07-03 05:45:50 -07:00
filesystem.h flush flash filesystem once a second 2019-03-20 12:21:36 -04:00
flash_root_pointers.h Move atmel-samd to tinyusb and support nRF flash. 2018-11-08 17:25:30 -08:00
flash.h Rework flash flush so it preserves the cache 2019-04-03 18:28:27 -07:00
memory.h Hook up the terminal based on the first display. 2019-01-31 11:42:14 -08:00
port.h Add functions to get top and limit stack 2019-10-18 11:04:45 +02:00
serial.h Move atmel-samd to tinyusb and support nRF flash. 2018-11-08 17:25:30 -08:00
spi_flash_api.h Move atmel-samd to tinyusb and support nRF flash. 2018-11-08 17:25:30 -08:00
supervisor.mk Allow boards to change the "CircuitPython" text in their USB interface description. 2019-11-12 13:29:35 -08:00
usb.h Move atmel-samd to tinyusb and support nRF flash. 2018-11-08 17:25:30 -08:00