The Simplest gettext PO file compiler
MULAN compiles *.po
file into a simple-formatted binary data.
$ cat in
msgid "Hello World"
msgstr ":fa5_cat:こんにちは世界:fa5_cat:"
$ mulan compile --output out --icon fontawesome5 in
$ xxd out
00000000: 6c08 093a 6f57 206f 1b00 ef9a bee3 8193 l..:oW o........
00000010: e382 93e3 81ab e381 a1e3 81af e4b8 96e7 ................
00000020: 958c ef9a be
The compiled binary is formatted as below.
Please note that MULAN supports only msgid
and msgstr
.
+---+---+---+---+---+---+---+---+---------+---------+---+---+---+---+---+-----+
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | ...
+---+---+---+---+---+---+---+---+---------+---------+---+---+---+---+---+-----+
| u64 little endian | u16 little endian | string...
+-------------------------------+-------------------+-------------------------+
| msgid hash | msgstr size | msgstr
+-------------------------------+-------------------+-------------------------+
You can see test directory to how this works actually.
WTFPLv2