paragui-users
[Top][All Lists]
Advanced

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

[paragui-users] Layout files and GNU gettext


From: address@hidden
Subject: [paragui-users] Layout files and GNU gettext
Date: Thu, 22 Dec 2005 15:19:22 +0800

Dear all:
        I am using paragui-1.1.8 with enable-unicode for my application.
        It works if I modified my layout files to another language such
as Chinese, but
        I would like to use GNU gettext since I may need several
language support.

        Hence, I modified PG_Layout a bit to use gettext() when parsing.
        Like this: (brainless one)

char *PG_Layout::GetParamStr(const char **Source, char *What)
{
  char **c;

  for (c = (char **)Source;*c; c += 2)
    if (tcscmp(T(*c),T(What)) == 0) {
      if((tcscmp(T(What),T("text")) == 0 ||
          tcscmp(T(What),T("title")) == 0 ||
          tcscmp(T(What),T("b1text")) == 0 ||
          tcscmp(T(What),T("b2text")) == 0 ||
          tcscmp(T(What),T("ltext")) == 0 ||
          tcscmp(T(What),T("caption")) == 0) &&
          tcscmp(T(*(c+1)),T("")) != 0)
        return(gettext(*(c+1)));
      else
        return(*(c+1));
    }
  return(&Empty);
}

        It works but it's not a good solution overall.

        Then I encounter another problem.
        "How do I use xgettext with layout files?"
        I may use Glade solution, i.e. generate a C header file from
layout files
        and it shall be easy to program.

        I would like to hear someone got a better idea for how to
integrate GNU gettext with Paragui.
        Any suggestions? Thanks.

Best,
Li TsungLin





reply via email to

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