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

2007-11-12 Thread Sven Neumann
Hi,

On Mon, 2007-11-12 at 21:49 +, Carlo Baldassi wrote:

> Ooops, sorry, I didn't notice there was an SVN version of the
> template. It's the link on the sidebar of developer.gimp.org which
> points to the buggy version.

We will release a fixed version of the plug-in template at some point in
a not too distant future. Michael is already working on this.

> Still, about the other bug, even with the SVN version the help file
> doesn't work with the helpbrowser in 2.4.1.

As I said already, it should work fine with GIMP 2.4.2 when that is
released. And that's only a matter of weeks, if not days only.


Sven



___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


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

2007-11-12 Thread Carlo Baldassi
> It is.
> gimp_plugin_domain_register (GETTEXT_PACKAGE, LOCALEDIR);

Ooops, sorry, I didn't notice there was an SVN version of the template. It's 
the link on the sidebar of developer.gimp.org which points to the buggy version.
Still, about the other bug, even with the SVN version the help file doesn't 
work with the helpbrowser in 2.4.1.

Carlo






  ___ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: 
http://it.docs.yahoo.com/nowyoucan.html___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


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

2007-11-12 Thread Carlo Baldassi
Hi,

> > This should be:
> > 
> >   gimp_plugin_domain_register (GETTEXT_PACKAGE, LOCALEDIR);
> 
> It is.
> 
> main.c:
>
>   gimp_plugin_domain_register (GETTEXT_PACKAGE, LOCALEDIR);

Is there a more recent version of the plug-in-template I don't know of?
I only found the one at ftp://ftp.gimp.org/pub/gimp/plugin-template/  and in 
that one
the register line is wrong.
If so, the link at developer.gimp.org should be updated.
Thanks

Carlo





  ___ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: 
http://it.docs.yahoo.com/nowyoucan.html___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


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

2007-11-12 Thread Michael Schumacher
Sven Neumann wrote:

> This should be:
> 
>   gimp_plugin_domain_register (GETTEXT_PACKAGE, LOCALEDIR);

It is.

main.c:

gimp_plugin_domain_register (GETTEXT_PACKAGE, LOCALEDIR);


HTH,
Michael

-- 
GIMP > http://www.gimp.org  | IRC: irc://irc.gimp.org/gimp
Wiki > http://wiki.gimp.org | .de: http://gimpforum.de
Plug-ins > http://registry.gimp.org |
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


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

2007-11-12 Thread Sven Neumann
Hi,

On Sat, 2007-11-10 at 23:23 +, Carlo Baldassi wrote:

> > > In fact, the call to gimp_domain_register() was already present in
> the
> > > gimp-plugin-template:
> > > 
> > > gimp_plugin_domain_register (PROCEDURE_NAME, LOCALEDIR);
> > > 
> > > It returns success, but the menu entry is not translated.
> > > I couldn't find any help from other plugins' sources because they
> > > don't register this way.
> > 
> > Does LOCALEDIR have the correct value? Are the translations actually
> > installed in the folder that it points to?
> 
> Yes, I checked it directly. Everything else is localized, it's just
> the menu entry.
> In fact, the i18n initialization function uses the same location:
> 
> bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);

I checked again and it is the other parameter which is wrong:

  gimp_plugin_domain_register (PROCEDURE_NAME, LOCALEDIR);

This should be:

  gimp_plugin_domain_register (GETTEXT_PACKAGE, LOCALEDIR);

If this is wrong in the plug-in template, then we should fix this and
release an updated version as soon as possible.


Sven


___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


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

2007-11-10 Thread Carlo Baldassi
Hi,

> > In fact, the call to gimp_domain_register() was already present in
 the
> > gimp-plugin-template:
> > 
> > gimp_plugin_domain_register (PROCEDURE_NAME, LOCALEDIR);
> > 
> > It returns success, but the menu entry is not translated.
> > I couldn't find any help from other plugins' sources because they
> > don't register this way.
> 
> Does LOCALEDIR have the correct value? Are the translations actually
> installed in the folder that it points to?

Yes, I checked it directly. Everything else is localized, it's just the menu 
entry.
In fact, the i18n initialization function uses the same location:

bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);

> > Another problem I found is that the GIMP helpbrowser doesn't read the
> > help files correctly
> > it seems that I need to register a title somehow
> 
> Your HTML help page needs to have a title, that's all.

The HTML page does have a title:




  
  Help Page for gimp-plugin-template


I have also tried to use one of the help pages from a standard plugin, as it 
was, just to test if I was
missing some tag: same error.

Carlo





  ___ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: 
http://it.docs.yahoo.com/nowyoucan.html___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


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

2007-11-10 Thread Sven Neumann
Hi,

On Sat, 2007-11-10 at 04:59 +, Carlo Baldassi wrote:


> In fact, the call to gimp_domain_register() was already present in the
> gimp-plugin-template:
> 
> gimp_plugin_domain_register (PROCEDURE_NAME, LOCALEDIR);
> 
> It returns success, but the menu entry is not translated.
> I couldn't find any help from other plugins' sources because they
> don't register this way.

Does LOCALEDIR have the correct value? Are the translations actually
installed in the folder that it points to?

> Another problem I found is that the GIMP helpbrowser doesn't read the
> help files correctly
> (no problem when using firefox, though). The crash occurs in
> helpbrowser/dialog.c,
> inside the function browser_dialog_make_index_foreach(), at this
> point:
> 
> indices = g_strsplit (item->title, ".", -1); /* THIS CALL FAILS */
> 
> for (i = 0; i < 5; i++)
> {
>   if (! indices[i])  /* CRASH HERE */
> break;
> 
>   item->index += atoi (indices[i]) << (8 * (5 - i));
> }
> 
> and that's because item->title is NULL.

I've fixed that last night; the fix will be in GIMP 2.4.2.

> Thus, it seems that I need to register a title somehow

Your HTML help page needs to have a title, that's all.


Sven

> 

___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


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

2007-11-09 Thread Carlo Baldassi
Hi,

still about porting plugins form 2.2 to 2.4:

> This is not the correct solution. Instead the plug-in is supposed to
 use
> gimp_plugin_domain_register() to tell the GIMP core about the
 textdomain
> that the plug-in uses for translation. The core will then be able to
> translate the menu entry.

In fact, the call to gimp_domain_register() was already present in the 
gimp-plugin-template:

gimp_plugin_domain_register (PROCEDURE_NAME, LOCALEDIR);

It returns success, but the menu entry is not translated.
I couldn't find any help from other plugins' sources because they don't 
register this way.

Another problem I found is that the GIMP helpbrowser doesn't read the help 
files correctly
(no problem when using firefox, though). The crash occurs in 
helpbrowser/dialog.c,
inside the function browser_dialog_make_index_foreach(), at this point:

indices = g_strsplit (item->title, ".", -1); /* THIS CALL FAILS */

for (i = 0; i < 5; i++)
{
  if (! indices[i])  /* CRASH HERE */
break;

  item->index += atoi (indices[i]) << (8 * (5 - i));
}

and that's because item->title is NULL.

Thus, it seems that I need to register a title somehow, but I didn't find any 
documentation online
about how to prepare an help file. Again, the standard plugins were of no help 
to me.
Any help/hint/clue/link would be appreciated.

> BTW, it would be nice if we could release an updated version of
> gimp-plugin-template for GIMP 2.4. Any volunteers to update the
 template
> in SVN?

If I manage to get it tworking I would be glad to send you my patches!

Carlo





  ___ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: 
http://it.docs.yahoo.com/nowyoucan.html___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


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

2007-11-06 Thread Michael Schumacher
> Von: Sven Neumann <[EMAIL PROTECTED]>
 
> BTW, it would be nice if we could release an updated version of
> gimp-plugin-template for GIMP 2.4. Any volunteers to update the template
> in SVN?

Here. 

I have to figure out why (some) third-party plug-ins don't find their 
translations on Win32 anyway, and testing this with the plugin template would 
be a good place to start from.



Michael
-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


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

2007-11-06 Thread Sven Neumann
Hi,

On Tue, 2007-11-06 at 08:36 +, Carlo Baldassi wrote:

> 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:

This is not the correct solution. Instead the plug-in is supposed to use
gimp_plugin_domain_register() to tell the GIMP core about the textdomain
that the plug-in uses for translation. The core will then be able to
translate the menu entry.

The rationale behind this is that the GIMP core needs to know the
untranslated strings to correctly handle stuff like menu branches.

BTW, it would be nice if we could release an updated version of
gimp-plugin-template for GIMP 2.4. Any volunteers to update the template
in SVN?


Sven


___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


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

2007-11-06 Thread Carlo Baldassi
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 <[EMAIL PROTECTED]>",
  "Michael Natterer <[EMAIL PROTECTED]>",
  "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___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


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

2007-11-06 Thread Carlo Baldassi
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 <[EMAIL PROTECTED]>",
  "Michael Natterer <[EMAIL PROTECTED]>",
  "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___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer