[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gettext patch (beta)

From: Carles Pina i Estany
Subject: gettext patch (beta)
Date: Wed, 21 Jan 2009 22:17:06 +0100
User-agent: Mutt/1.5.18 (2008-05-17)


I have been working with the gettext patch (and Robert gave me a hand,

Take this version as a RFC and call for help (see at the bottom, it
includes beer invitation in Fosdem).

YYYY-MM-DD  Carles Pina i Estany <address@hidden>

        * Add uptrans target to help to update .pot file
        * conf/common.rmk: Add grub-gettext_lib target, dependency and
        * kern/misc.c: Define grub_gettext symbol and add implement
          grub_gettext_dummy function
        * po/TODO: Temporary file with instructions of what
          will do
        * po/ca.po: Catalan translation stub
        * include/grub/misc.h: Define macro _(char *s). Declare
          grub_gettext_dummy and grub_gettext
        * gettext/gettext.c: New file with gettext implementation
        * normal/menu.c (print_message): add _( ) to some strings
        * util/grub.d/ include grub-gettext_lib file.
          For the Linux menuentry, call eval_gettext
        * util/grub.d/ add locale_prefix and gettext 
          locale detection and setting up the access to the mo directory
        * util/ add get_locale_lang
        * util/ new file

How to test and see something:
-Apply the patch

-In po/ execute msgfmt ca.po -o

-Copy to /usr/share/locale/ca/LC_MESSAGES/

-Compile and install the patched Grub

-Maybe the new 00_header will detect your language and add the 
 configuration (this has not been tested)

-In Grub2 console you should:
set lang=ca
set locale_prefix=/usr/share/locale
insmod gettext

Then the lines under the menu box will appear in Catalan.

The gettext module has a hook to the lang variable, if you change lang to 
a new value, it will reload the file. Ops! And I didn't do any hook for
locale_prefix, I will do it but by the moment you can rmmod gettext
and insmod again

I need to write the (see po/TODO :-( ). I'm not used or
familiar to write Makefiles :-( if someone wants to help it would 
speed up the process quite much. It needs only to merge the files with
the new .pot, compile (msgfmt), and install to the correct directory.

I exactly know what has to do, so if someone knows about
installation/Makefiles and doesn't know about gettext it's not a
problem, contact me. Else I will try to implement soon.

I would even invite to a couple of beers in Fosdem if someone does
this part :-)

-and more testing about 00_header with gettext detection.
-Add _("") for mainly all strings (I would do in a separate patch)
-I have seen that Grub2 is not printing correctly the accents,
could be a problem in gettext or in some other layer

Carles Pina i Estany            GPG id: 0x17756391

Attachment: gettext01.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]