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

gEDA: [OT] gettext_noop(): problem with empty strings



Hi all,

geda contains untranslated strings. The strings are in structs and there 
are empty entries:

char * text[] = {"text1", "", "blablub" };

the info pages of gettext tells, that I have to use the gettext_noop() 
macro or the short form N_() of it:

char * text[] = {N_("text1"), N_(""), N_("blablub") };

When I use the strings:

for (i=0; i<3; i++)
	printf("%s\n", gettext(text[i]));

the translation fails for the empty string because

	gettext("");

will return the header of the po file including the translator the 
translation date and so on.

There's a workaround for empty strings. Just don't translate if the 
string is empty:

for (i=0; i<3; i++)
	printf("%s\n", strlen(text[i]) ? gettext(text[i]) : text[i])

Is there an easier solution for that problem?

regards
Werner