not unescaped translated label in libbonoboui



Following IRC discussion with michael, here is a summary of the problem
in libbonobui (GNOME 2, not GNOME 1.4).

First an example :
Just start nautilus 1.1.11 in french, and right click on the desktop
background... The last menu entry should be "Changer le fond d'écran"
but we get "Changer le fond d'écran" (this is for "Modify Desktop
background" ...)

Explanation :

In bonobo_ui_util_set_ui, label translations is loaded from .po in
bonobo_ui_util_translate_ui (through bonobo_ui_util_new_ui)

It modifies node values from the english string to translated string..
After this translation task, node tree is converted into string with a
call to bonobo_ui_node_to_string.. But in internal_to_string (called by
bonobo_ui_node_to_string), some characters are escaped ( ' => &  "
=> &quote; ...) and this causes problems with translated UI, since
theses escaped strings are not unescaped when used to set labels in GTK+
UI :((

Problems :

First, I'm not sure we should not do this escaping ourself (moreover,
this escaping code has been grabbed from glib, therefore, if something
is fixed in glib, we won't notice :(( It would be better to use libxml2
API to do that or g_markup_escape_text from glib2 (not sure..)

Second, and much more problematic, it seems we never unescape values
before using them to set labels in gtk :((

I hope my explanations are clear enough.. (I'm not sure..)

I can't see how to fix this thing in a clean way (no longer escaping
will probably break thing but on the other hand, I'm not sure where we
should unescape strings and how to be sure we fully unescape them..)

-- 
Frédéric Crozat
MandrakeSoft




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]