Plug-in localization was always partially plug-in side, especially for
things like custom GUI. But labels or blurb in GIMP (such as in menus or
action search) were localizing GIMP side.
It had many drawbacks:
- To get menu localization, a plug-in had to set up gettext, even though
they might want to use something else for their GUI (after all, giving
facilities for gettext is a good idea, but there is no reason to force
using this system).
- There was a complex internal system passing the localization domain
name, as well as the catalog file system path to core, then through
various classes which we can now get rid of.
- There could be domain name clashes, if 2 plug-ins were to use the same
i18n domain name. This was handled in now removed functions
gimp_plug_in_manager_get_locale_domains() by simply keeping a unique
one (and gimp_plug_in_manager_bind_text_domains() would just bind the
domain to the kept directory). In other words, one of the duplicate
plug-ins would use the wrong catalog. We could try to make the whole
thing more complicated or try to forbid plug-ins to use any random
name (in particular made easier with the new extension wrapper). But
anyway this whole issue doesn't happen anymore if localization is
fully made plug-in side, so why bother?
I tried to evaluate the advantages of the core-side localization of
plug-in labels/blurbs and could only find one theoretical: if we wanted
to keep access to the original English text. This could be useful
(theoretically) if we wanted to search (e.g. in the action search) in
both localized and English text; or if we wanted to be able to swap
easily en/l10n text in a UI without reload. But even if we were to ever
do this, it would only be possible for plug-ins (GEGL operations in
particular are localized GEGL-side), so it lacks consistency. And it's
unsure why special-casing English should really make sense for other
language natives who want text in their lang, and search in their lang.
They don't necessarily care about original.
So in the end, I decided to simplify the whole thing, make localization
of plug-ins a plug-in side thing. Core will only receive translated text
and that's it. It cuts a lot of code out of the core, simplify runtime
processing and make plug-in creation simpler to understand.
The only think I still want to look at is how exactly menu paths are
translated right now. Note that it still works, but it's possible that
some things may be worth improving/simplifying on this side too.
gimp_procedure_set_static_help().
The indentation was wrong, probably because of changes to function
names. Fix the generation scripts and regenerate the PDB C files.
We changed the logic of _gimp_plug_in_domain_register() which is now
only called when a domain is explicitly registered (which is not the
case by default anymore). Let's update the function documentation and
also make it clear that third-party developers in particular should not
play with it if they want their plug-ins to be properly localized.
Fix the dependency by making the stamp an actual (yet empty/no-op)
header file which is included by all generated source file. This way, we
ensure that meson rebuild .o files when the .pdb sources are changed.
This is the second solution proposed by eli-schwartz here:
https://github.com/mesonbuild/meson/issues/10196#issuecomment-1080053413
and call it gimp_pdb_set_proc_icon(). Change icon registration code in
libgimp/ and app/ so it's now possible to register icons for temporary
procedures.
- remove the menu path and image types from "gimp-plugins-query",
they are available via GimpProcedure, also reorder and rename
its remaining return values to make sense
- remove the "menu_path" parameter to gimp_proc_view_new(),
it can also ask GimpProcedure
- adapt plugin-browser to the new API and make it use GimpProcedure
- fix plugin-browser's tree view to show all menu hierarchies
completely, it was still expecting menu paths that contain
the menu label too
on behalf of plug-in authors who have no style or can't type.
Instead, simply reject non-canonical procedure names and remove all
code that keeps aroud the original non-canonical shit just to pass it
back to the plug-in.
It was agreed that we should write "plug-in" consistently. Only possibly
user-visible strings were updated.
Thanks to scootergrisen for a first patch which could not make it
after changing decision on the canonical writing.
and keep GIMP_ICON_TYPE_STOCK_ID as a deprecated alias. Change all
plug-ins accordingly and increase the pluginrc file version number so
it gets regenerated with "icon-name" instead of "stock-id".
Add gimp_plugin_enable_precision() in libgimp which switches the
plug-in to deal with the drawables' real precision, call it from the
libgimp GeglBuffer and Babl format APIs. If it's not enabled, let the
core's plug-in convert the tiles to legacy formats when sending them
over the wire.
2009-01-17 Michael Natterer <mitch@gimp.org>
* all files with a GPL header and all COPYING files:
Change licence to GPLv3 (and to LGPLv3 for libgimp).
Cleaned up some copyright headers and regenerated the parsers in
the ImageMap plugin.
svn path=/trunk/; revision=27913
2008-10-09 Michael Natterer <mitch@gimp.org>
Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h
had a GEGL dependency (they will have in the next commit, but I
wanted to keep the commit separate).
* app/dialogs/Makefile.am
* app/file/Makefile.am
* app/gui/Makefile.am
* app/menus/Makefile.am
* app/paint/Makefile.am
* app/plug-in/Makefile.am
* app/text/Makefile.am
* app/vectors/Makefile.am
* app/widgets/Makefile.am
* app/xcf/Makefile.am: add GEGL_CFLAGS.
* app/actions/*.c
* app/core/*.c
* app/dialogs/*.c
* app/display/*.c
* app/file/*.c
* app/gui/*.c
* app/menus/*.c
* app/paint/*.c
* app/pdb/gimppdb-utils.c
* app/pdb/gimpprocedure.c
* app/plug-in/*.c
* app/text/*.c
* app/tools/*.c
* app/vectors/*.c
* app/widgets/*.c
* app/xcf/*.c: add <gegl.h> or replace <glib-object.h> by <gegl.h>
to all files which include a drawable subclass or gimpimage.h
* tools/pdbgen/app.pl: include <gegl.h> instead of <glib-object.h>
in all generated files.
* app/pdb/*-cmds.c: regenerated.
* data/images/gimp-splash.png: the goat is still sleeping.
By Aurore Derriennic.
svn path=/trunk/; revision=27202
2008-08-19 Sven Neumann <sven@gimp.org>
Complements the fix for bug #344818:
* libgimpbase/gimpbaseenums.[ch]: added new enum
GimpPDBErrorHandler.
* tools/pdbgen/enums.pl: regenerated.
* app/plug-in/gimpplugin.[ch]: added error_handler to
GimpPlugIn.
* app/plug-in/gimpplugin-message.c
(gimp_plug_in_handle_proc_run):
only display an error message for a failed procedure call if the
plug-in's error-handler is set to
GIMP_PDB_ERROR_HANDLER_INTERNAL.
* tools/pdbgen/pdb/plug_in.pdb: added PDB getter and setter for
the plug-in's error-handler.
* app/pdb/plug-in-cmds.c
* app/pdb/internal-procs.c
* libgimp/gimpenums.c.tail
* libgimp/gimpplugin_pdb.[ch]: regenerated.
* plug-ins/common/file-compressor.c
* plug-ins/file-uri/uri.c: set the error-handler to
GIMP_PDB_ERROR_HANDLER_PLUGIN as these plug-ins are forwarding
the
error with their return values.
svn path=/trunk/; revision=26656
2008-08-16 Sven Neumann <sven@gimp.org>
If a procedure call fails, pass a string describing the error as
the second return value. First step towars fixing bug #344818.
* app/pdb/gimpprocedure.[ch] (gimp_procedure_get_return_values):
added a GError parameter. If it is set, pass the error message
to
the return values.
* app/pdb/gimppdberror.h: added some more error codes.
* app/pdb/gimppdb.c
* app/xcf/xcf.c: pass errors to
gimp_procedure_get_return_values().
* app/plug-in/gimpplugin-message.c
(gimp_plug_in_handle_proc_run):
show a different error message for execution vs. calling errors.
* app/plug-in/gimpplugin-progress.c
(gimp_plug_in_progress_cancel_callback): pass the error
GIMP_PDB_CANCELLED to gimp_procedure_get_return_values().
* app/plug-in/gimppluginmanager-call.[ch]
(gimp_plug_in_manager_call_run): removed the
'destroy_return_vals'
parameter.
* app/plug-in/gimppluginprocedure.c: destroy the return values
here.
* app/plug-in/gimppluginprocframe.c: pass an error to
gimp_procedure_get_return_values().
* tools/pdbgen/app.pl
* tools/pdbgen/pdb/fileops.pdb: generate code that passes the
error to gimp_procedure_get_return_values().
* app/pdb/*-cmds.c: regenerated.
* plug-ins/pygimp/pygimp-pdb.c: extract the error message from
the
return values and pass it to the exception that is thrown.
svn path=/trunk/; revision=26593