Gettext without file system

For an embedded system with a graphical interface, we use our translation system. Strings are stored in the ROM of the microcontroller.

Currently we have up to 10 languages ​​and about 400 translated lines (depending on the product variant).

Our current system is rather cumbersome, and I think gettext would be the best solution.

As far as I understand gettext, to install a directory containing compiled translation files (* .mo) is required bindtextdomain.

Is there a way to read the translation from memory instead? That is, I would like to include the compiled * .mo files in the binary and configure gettext to use them. Alternatively, translation data will be stored in data EEPROM without a file system.

Or can you recommend another translation system for use in a microcontroller system (16 or 32 bits, ROM from 256 to 512 kilobytes) with a C interface?

Edit: I must add that the ability to support translations, in addition to the firmware of the microcontroller, will be the reason for switching to gettext. The relevant translation data will be downloaded by the user using the configuration software that we already supply on our systems.

+5
source share
1 answer

, : ".mo" . char ".mo" . ".mo", .

libintl sourcecode . loadmsgcat.c, _nl_load_domain. , mmap() ( ). , , ".mo" .

, , , . .

+3

All Articles