GNOME Bugzilla – Bug 301118
no way to specify the translation domain explicitly with bonobo_ui_util_translate_ui()
Last modified: 2005-05-02 20:19:31 UTC
We can't use bonobo_ui_util_translate_ui() (or any other bonobo_ui_util_* functions which use it) in a library. Because this function does translation just with gettext(), which assumes the translation domain is implicit. One example is gtkhtml: 1. run evolution in any non-english locale 2. new mail 3. From menu: Format -> Paragraph... 4. some strings still remains untranslated. The UI file should use "gtkhtml-3.6" (assuming evolution 2.2.x and gtkhtml 3.6.x) as its translation domain. But the bonobo_ui_util_translate_ui() function uses "evolution-2.2" implicitly. We need a way to specify the translation domain explicitly, IMHO with a new API.
I guess not; please do feel free to knock up an API expansion to do that, I guess it's a right pain having to do that translation yourself. Thanks.
IThe current bonobo_ui_util_translate_ui() is not very general. In any way it doesn't have to assume the translation domain is implicit. It may be possible to fix gtkhtml without modifying libbonobou, but by just copying & modifying the whole functions.
cut & paste is evil; it may be necessary for a few versions to avoid dependency problems - but lets make sure we fix the underlying problem too.
Created attachment 45441 [details] [review] A try to add some expanded functions A try to add the translation domain parameter to the functions. Not sure whether this approach is prefered though.
The patch looks great to me, please do commit it to HEAD.
Thanks for the review. Commited with changelog: * bonobo/bonobo-ui-util.c (bonobo_ui_util_new_ui_with_domain, bonobo_ui_util_translate_ui_with_domain): New functions which do the same things as bonobo_ui_util_new_ui() and bonobo_ui_util_translate() respectively but translate with the specified translation domain. Fixes #301118. * bonobo/bonobo-ui-util.h: bonobo_ui_util_new_ui_with_domain() and bonobo_ui_util_translate_ui_with_domain() prototypes.
I found a simple fix for bug 301120, without any need of bonoboui change. So I doubt whether this bug is really a problem. I'm about to revert my changes in HEAD and set this bug as NOTABUG. Furtunately no apps in the cvs use these new functions yet. I don't want to add library functions without any real need.
I reverted it. Sorry for the noise.