Review how plug-in localization works
This is something I have wanted to do for some time now, which is review how plug-ins are localized. What we need is to be able to:
-
Propose a good base API for localization using gettext. -
Allow for plug-ins to use other API if needed.
I have just pushed some commit 82f9ae1a to force-trigger the query() run of all plug-in when a language change is done, so that parameter are properly localized, core-side as well.
The other thing which has to be properly localized are a plug-in procedure "menu label" and "documentation" (cf. gimp_procedure_set_menu_label()
and gimp_procedure_set_documentation()
).
Right now, these are localized on core-side (see gimp_plug_in_procedure_get_menu_label()
and gimp_plug_in_procedure_get_blurb()
; though not sure if the help is localized, at least not in gimp_procedure_get_help()
) using the locale domain and folder set with bindtextdomain()
.
The main issue with this approach is that it works ok for our core plug-ins which have a few .mo
files actually installed with GIMP. But it would not work well for third-party plug-ins (which is why this relies on a macro in a header stdplugins-intl.h
which is not installed with GIMP). So it would be good if we had a public API so that third-party plug-ins could just release .mo
files within their plug-in (and extension .gex
files). And what if they want to use other localization systems? I don't think we should force gettext. If the translated strings are fully in runtime or loaded with query()
(which is now re-run after a language change), it should work fine.
I am opening this report to follow up this issue and not forget before GIMP 3.0 release.