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

Re: gettext



Thx very much:-)
thhsieh@linux.org.tw wrote:

> : Hi!
> : I want to know something about getetxt() usage
> : How can I deal with array?
> : for example:
> :
> : char *title[]={"hello", "world"};
> :
> : what should I do to export "hello" and "world " to *.pot by xgettext?
>
> Hello, please try this: If you have a program like the following:
>
> ============================================================================
> /* This is program test.c */
>
> #include <stdio.h>
> #include <libintl.h>
>
> #define _(msg)  gettext(msg)
> #define N_(msg) (msg)
>
> main()
> {
>     char *title[] = {N_("hello"), N_("world")};
>     int idx;
>
>     idx = 0;
>     printf(_("string 1: %s %s\n"), _(title[idx]), _(title[idx+1]));
> }
> ============================================================================
>
> Then invoke xgettext as:
>
>         xgettext --keyword=N_ --keyword=_ -o test.pot test.c
>
> See info gettext, * Sources::, * Special cases::   for details.
>
> T.H.Hsieh
>
> --
> | This message was re-posted from debian-chinese-big5@lists.debian.org
> | and converted from big5 to gb2312 by an automatic gateway.
>
> --
> To UNSUBSCRIBE, email to debian-chinese-gb-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

-- 
| This message was re-posted from debian-chinese-gb@lists.debian.org
| and converted from gb2312 to big5 by an automatic gateway.



Reply to: