Hi,

On Jun/26/2009, Robert Millan wrote:

> Also, if *.mo files contain plain text, compression would work well on
> them.  They could be gzipped.

Yes, they contain plain text.

I implemented gettext without the hashtable (the .mo files usually has a
hashtable for the search). We will not have lot of strings, so we don't
need the hash table to speed up and we safe some space in implementation
and the .mo file.

I haven't counted the overhead of using a .mo file instead a other
solutions, but it's very reasonable.
Actually this file (.po simplified file):
-------------
#: normal/menu.c:90
#, c-format
msgid ""
"\n"
"      Use the %C and %C keys to select which entry is highlighted.\n"
msgstr ""
"\n"
"      Utilitzeu les tecles %C i %C per seleccionar l'entrada.\n"

#: normal/menu.c:93
msgid ""
"      Press enter to boot the selected OS, 'e' to edit the\n"
"      commands before booting or 'c' for a command-line."
msgstr ""
"      Presioneu retorn per arrancar el SO seleccionat, 'e' editar\n"
"      les comandes abans d'arrancar, 'c' per línia d'ordres."

#: util/grub.d/10_linux.in:143
#, sh-format
msgid "${OS}, linux ${version} (recovery mode)"
msgstr "${OS}, linux ${version} (mode recuperació)"

#, sh-format
msgid "hello"
msgstr "hola"
---------------
car...@pinux:~/grub/grub2/po$ msgfmt --no-hash ca.po -o test.mo
car...@pinux:~/grub/grub2/po$ ls -la ca.po  test.mo 
-rw-r--r-- 1 carles carles 680  8 mar 19:08 ca.po
-rw-r--r-- 1 carles carles 562 27 jun 00:42 test.mo
car...@pinux:~/grub/grub2/po$ 

so, in terms of size it's even smaller than the .po file (it avoids the
comments, etc.)


-- 
Carles Pina i Estany
        http://pinux.info


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to