Re: i8n problems

On Thu, 18 Nov 1999, Chris Jones wrote:
> I was following the tutorial on and read some of
> GGAD to figure out how to make my application capable of being
> translated easily. I got everything setup properly and created the
> intl/ and po/ directories and filled them with the correct files.
> Everything compiles and works, so I'm happy with that, but I have an
> annoying problem, I'm keeping my source in a CVS tree and when I added
> the new files to it, it created the files in /intl (all symlinks to
> the GNU gettextize stuff), they were created as 0 byte files and as a
> result I can't do CVS commits anymore because it is moaning about the
> intl/ drawer being wrong. I know this isn't strictly relevant here,
> but I'm wondering if anyone with more CVS experience has come across
> this problem before and if so, how do I fix it?

I think what we finally decided is that "intl" shouldn't go in CVS; the
current GNOME automatically runs "gettextize" to create it.
> Also, I have some strings that are in arrays:
> gchar *message_list_titles[] = {
> 	N_("Status"), 
> 	N_("From"),
> 	N_("Subject"),
> 	N_("Received"),
> 	N_("mId")
> };
> >From reading the i8n tutorial, I put N_() around them, but it then
> says that when the string is later used to put _() around it. How can
> I do that here? This array is passed whole to a GtkCList so I can't
> _() the individual strings.

Unfortunately I think you have to call the _() function, probably means
copying the strings into another array. You might do this:

static const gchar** 
 static const gchar* titles[5] = { NULL, NULL, NULL, NULL, NULL};
 if (*titles == NULL) 
    titles[0] = _("Blah");
    titles[1] = _("Foo");


 return titles;

Which isn't all that bad.


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