For what it's worth, here is my opinion on the Tip of the Day messages and their translations. In summary: keep it simple! I know that being the one who introduced these tips in the Gimp does not grant me any special priviledges (especially since I am not translating them) but it looks like the easiest option for the translators would be to put the tips in a .h header file and the translations in .po files.
Although it could appear to be less flexible than using an XML file, the header file has the advantage that it can be translated in the exact same way as any other part of the Gimp, without requiring any special method or special tool. All translators who are able to translate the code of the Gimp will automatically know what they have to do in order to translate the tips (this is important for those who come from the GNOME translation team and may not be very familiar with the Gimp yet). It will also reduce the size of the code because we do not use a separate parser and all the gettext stuff is already used by other parts of the code. (*)
As Sven already mentioned, the solution would consist of adding a new file gimp_tips.h in the source code, containing something like this:
const gchar *tips[] = { N_("This is the first tip."), N_("This is the second tip and it has <b>bold</b> text."), N_("This is the last tip. Now, you are on your own.") }; gint n_tips = G_N_ELEMENTS (tips);
The multi-line tips should be included in one string (with line breaks) because that will be easier to translate.
This format does not prevent anybody from exporting the tips to an XML or HTML file and then importing it into another tool. For example, we could include the following very simple program in the source distribution of the Gimp:
#include "config.h" #include <stdio.h> #include "libgimp/gimpintl.h" #include "gimp_tips.h"
int main (int argc, char **argv) { gint i;
INIT_LOCALE ("gimp"); printf ("<gimp-tips>\n"); for (i = 0; i < n_tips; i++) { printf (" <tip>\n %s\n </tip>\n", tips[i]); } printf ("</gimp-tips>\n"); }
This very simple program (or a more elaborated version of it) would allow any translator to output the strings in any format that is suitable for usage in another environment.
-Raphael
(*) Here, I am talking both about the number of lines of source code that have to be maintained and the size of the compiled application. The size of the initialized data will be increased by 6 KB.