After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 345982 - Internationalisation improvements
Internationalisation improvements
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Internationalisation
git master
Other All
: Normal enhancement
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-06-26 20:48 UTC by Zbigniew Chyla
Modified: 2006-06-28 06:59 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Simplifies *-intl.h headers by including <glib/gi18n.h> (1.68 KB, patch)
2006-06-26 20:50 UTC, Zbigniew Chyla
committed Details | Review
Adds translation context (using Q_ macro) to some problematic strings (8.16 KB, patch)
2006-06-26 20:52 UTC, Zbigniew Chyla
committed Details | Review
Translation context + small correction in gimpunit.c file. (2.96 KB, patch)
2006-06-26 20:53 UTC, Zbigniew Chyla
committed Details | Review
Support for translation context in GimpEnumDesc.value_desc + added context to a few enums. (4.21 KB, patch)
2006-06-26 20:56 UTC, Zbigniew Chyla
committed Details | Review
Support for custom undo strings in transform tools (4.44 KB, patch)
2006-06-26 21:03 UTC, Zbigniew Chyla
committed Details | Review
Support for translation context in GimpStringActionEntry labels + added context to one string. (1.31 KB, patch)
2006-06-26 21:04 UTC, Zbigniew Chyla
committed Details | Review
Marked additional strings for translation (67.72 KB, patch)
2006-06-26 21:05 UTC, Zbigniew Chyla
none Details | Review

Description Zbigniew Chyla 2006-06-26 20:48:31 UTC
When working on Polish translations for GIMP I prepared a few patches that will improve quality of GIMP localisations. Most of them introduce context to translatable strings. Translation context makes it possible to provide correct translations in case of string (msgid) collisions.
Comment 1 Zbigniew Chyla 2006-06-26 20:50:11 UTC
Created attachment 68046 [details] [review]
Simplifies *-intl.h headers by including <glib/gi18n.h>
Comment 2 Zbigniew Chyla 2006-06-26 20:52:11 UTC
Created attachment 68047 [details] [review]
Adds translation context (using Q_ macro) to some problematic strings
Comment 3 Zbigniew Chyla 2006-06-26 20:53:35 UTC
Created attachment 68048 [details] [review]
Translation context + small correction in gimpunit.c file.
Comment 4 Zbigniew Chyla 2006-06-26 20:56:11 UTC
Created attachment 68049 [details] [review]
Support for translation context in GimpEnumDesc.value_desc + added context to a few enums.
Comment 5 Zbigniew Chyla 2006-06-26 21:03:14 UTC
Created attachment 68050 [details] [review]
Support for custom undo strings in transform tools
Comment 6 Zbigniew Chyla 2006-06-26 21:04:44 UTC
Created attachment 68051 [details] [review]
Support for translation context in GimpStringActionEntry labels + added context to one string.
Comment 7 Zbigniew Chyla 2006-06-26 21:05:57 UTC
Created attachment 68053 [details] [review]
Marked additional strings for translation
Comment 8 Sven Neumann 2006-06-27 07:30:48 UTC
Having separate bug reports for each of the patches would have made it a lot easier to respond. I will have a look at applying the patch to the header file, it looks good to me.

I am not sure if it isn't too late for the introduction of translation context. We are approaching string freeze and want to get the 2.4 release out of the door. I am afraid that this change will introduce translation errors. It may do more harm than good to do this now.

Your last patch will need careful review. Almost all strings in there have deliberately left untranslated. Only very few of the strings you marked for translation are actually supposed to be translated and have been left out accidentally.
Comment 9 Sven Neumann 2006-06-27 07:50:51 UTC
Applied all reasonable changes from the last patch:

2006-06-27  Sven Neumann  <sven@gimp.org>

	I18n improvements based on a patch from Zbigniew Chyla:

	* app/main.c:
	* modules/controller_midi.c
	* plug-ins/script-fu/scripts/guides-new.scm: marked strings for
	translation.

	* app/widgets/gimpdock.c
	* libgimpwidgets/gimppageselector.c
	* plug-ins/common/plugin-browser.c: use ngettext() for plural forms.

Comment 10 Sven Neumann 2006-06-27 07:56:11 UTC
Applied the first patch:

2006-06-27  Sven Neumann  <sven@gimp.org>

	Applied patch from Zbigniew Chyla:

	* app/gimp-intl.h
	* libgimp/stdplugins-intl.h: removed most content and include
	<glib/gi18n.h> instead.

	* libgimp/libgimp-intl.h: define ngettext() macro as wrapper around
	dngettext().

Comment 11 Sven Neumann 2006-06-27 08:01:13 UTC
Applied fixes from third patch:

2006-06-27  Sven Neumann  <sven@gimp.org>

	Based on a patch from Zbigniew Chyla:

	* app/core/gimpunit.c (_gimp_unit_get_singular, _gimp_unit_get_plural):
	don't call gettext() on strings returned by _gimp_unit_get_user_unit().

Comment 12 Sven Neumann 2006-06-27 16:01:08 UTC
So everything but the introduction of context to our translatable strings should be in CVS. I am undecided what to do about this issue. Does anyone have experience with this? Are other applications already successfully using this?
Comment 13 Zbigniew Chyla 2006-06-27 18:57:32 UTC
> Having separate bug reports for each of the patches would have made it a lot
> easier to respond.

Yeah, sorry. I'll make a few more mouse clicks next time :)

> I am not sure if it isn't too late for the introduction of translation
> context. We are approaching string freeze and want to get the 2.4 release
> out of the door.

That's what you said when I tried to introduce Q_() macro for the first time. It was over 5 years ago...
Unfortunately I don't know your release plans. I couldn't find any information on the web page.
Now the Q_() macro (and g_strip_context function) is provided by Glib so I consider context-aware translations to be a standard solution on GTK+/GNOME platform.

> I am afraid that this change will introduce translation errors.
> It may do more harm than good to do this now.

I don't think so. When updating po files, msgmerge will copy translations for new strings from their context-less variants with ", fuzzy" flag added.
For languages that don't need differentiation provided by a context you only need to remove ", fuzzy" - not too much work.
For other languages (like Polish) adding context is the only way to translate some strings correctly.

> Your last patch will need careful review. Almost all strings in there
> have deliberately left untranslated.

That's strange. All these strings are visible in the GUI ("Select Controller Event Action" window). Leaving them untranslated makes some parts of GIMP functionality available only to users who speak English.
Comment 14 Zbigniew Chyla 2006-06-27 19:26:29 UTC
> (...)
> Are other applications already successfully using this?

Both gtk+ and gnome-panel use Q_() in a few files.
Of course it would be hard to find anything comparable to GIMP - in contains huge number of translatable strings (and thus many collisions).
Comment 15 Sven Neumann 2006-06-27 19:33:17 UTC
OK, let's go with the translation context then. I will look into applying the remaining changes.

The strings you marked for translation have been left out because it's a huge amount of strings and almost no user ever uses them. Marking all these strings for translation would probably keep more translators busy than it would make users happy. At least for 2.4 we don't want them to be translated.
Comment 16 Sven Neumann 2006-06-27 20:11:22 UTC
I have applied the remaining context related changes. Thanks a lot for your patches. Closing as FIXED.
Comment 17 Sven Neumann 2006-06-28 06:59:35 UTC
Zbigniew, it would be very nice if you could have a look at README.i18n in the GIMP tree and perhaps overhaul it a bit. It does IMO contain too much information (it should be shorter). But it also lacks some of the new things like ngettext and translation context. It would be important to mention all these with pointers to more information. You would do me a large favor by submitting an updated version of README.i18n.