开发者

xgettext in gtk+

I am new to the gettext and Gtk+ programming world. First of all, I am developing an application on windows using the gtk+ library.

I read that glib integrates the gettext library and makes the translation more "friendly" by providing some wrappers. I follow the documentation from the g开发者_高级运维lib library and include the glib/gi18n.h header and mark all the strings for translation with the _() macro.

Then I downloaded gettext for windows from the Gnuwin32 project, but when I try to extract the strings with xgettext nothing happens. I have to use gettext() and not use the macro that the glib provides in order to be able to extract the strings. There must be some way to extract the strings with the glib macro and I know I'm missing something but can't figure out what.


I am going to answer my own question in case someone else has the same problem.

In order for xgettext to parse the settings that I marked with the _() macro, I have to put

--keyword=_

so that the xgettext knows what macro I used.

You can check a more complete answer in the xgettext manual.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜