[Top][All Lists]

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

Re: [XBoard-devel] Code formatting

From: H.G. Muller
Subject: Re: [XBoard-devel] Code formatting
Date: Wed, 6 Apr 2016 23:31:54 +0200
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

Op 4/6/2016 om 10:20 PM schreef Roland Illig:
When I looked at xoption.c, it seemed like a total mess to me.
Yeah, that is what you get when several different people with different styles
contribute code...
While there, I noticed this code:

     strcmp(option[i].name, "*")

Would that still work if I were to translate the "*" to something
different than "*"?
Yes, that would still work. The N_() around the "*" in the Option table
is just a marker to make software other than the compiler notice the "*" string, so that it ends up in the .pot file. To the compiler it is a no-op, and the string stays untranslated in the .name field of the Option. So the strcmp() compares
the untranslated .name with an untranslated "*" to recognize it. To create
the button with gtk_button_new_with_label(), the option[i].name is surrounded
with _(), so that the translation for "*" will appear on the button.

The same for the other one-letter buttons "B", "R" and "G" that are recogized
in the GTK version of xoptions.c in order to be ignored.

reply via email to

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