[Gimp-developer] problem (solved?) in gimp-plugin-template

Carlo Baldassi carlobaldassi at yahoo.it
Tue Nov 6 00:36:01 PST 2007


Hi,

I have developed a GIMP plugin using the plugin template, and I have been made aware of a problem in i18n support, which I think I solved: the plugin name was not translated correctly in the menu.

I think this is due to the fact that i18n is initialized in the run() function, while the plugin name is given in the query() function through a call to gimp_install_procedure()..
What I did was just copy-pasting the i18n init code right before the gimp_install_procedure() call, and substituting "N_(...)" with "_(...)", like
 this:

  /*  Initialize i18n support  */
  bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
 
 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif
  textdomain (GETTEXT_PACKAGE);

  gimp_install_procedure (PROCEDURE_NAME,
              "Blurb",
              "Help",
              "Michael Natterer <mitch at gimp.org>",
              "Michael Natterer <mitch at gimp.org>",
              "2000-2004",
              _("Plug-In Template..."),
              "RGB*, GRAY*, INDEXED*",
              GIMP_PLUGIN,
              G_N_ELEMENTS (args),
 0,
              args, NULL);

I don't know if the "N_(...)" call was meant to let it work, but in my system "gettex_noop()" is not defined, and "N_(...)" becomes "(...)" (don't know the reason of this). It seems to work well now, but I don't know if this procedure has any drawbacks (e.g. if initializing i18n twice gives any problem) or is incorrect for some reason.

Carlo Baldassi








      ___________________________________ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: http://it.docs.yahoo.com/nowyoucan.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /lists/gimp-developer/attachments/20071106/553137a8/attachment.html 


More information about the Gimp-developer mailing list