Re: i18n of app menus



On Mon, 2012-01-23 at 06:36 -0500, Matthias Clasen wrote:
> On Sun, Jan 22, 2012 at 3:13 PM, Olav Vitters <olav vitters nl> wrote:
> > How can those app menus be translated? Is anyone on the gnome-i18n
> > mailing list?
> 
> The same way gtkbuilder xml files can be translated. Specify the
> domain when loading the xml file, and put the strings into your mo
> file.
> You can use intltool with the usual _-prefixing convention for attribute names.

That's not the way GtkBuilder XML files have been translated. The
strings were extracted using intltool's glade mode, not xml mode.
This extracts the contents of any element with translatable="yes".
But now instead of translatable strings being in the contents of
marked elements, they're in attribute values. From epiphany:

http://git.gnome.org/browse/epiphany/plain/data/ui/epiphany-application-menu.ui

(BTW, GMarkup might accept those less-than characters in attribute
values, but they're not well-formed XML.)

We could translate these ui files using intltool's xml mode, but
then we need an extra step to strip the leading underscore, even
though we're not merging translations back into the XML. Also, I
assume these files are hand-written now, but Glade will learn to
output new-style menus eventually, and it's probably not going
to output mangled XML.

The best thing would be if menu definitions used the same way of
marking strings translatable as everything else. The second best
thing would be to teach intltool's glade mode to handle these
translatable attribute values.

--
Shaun




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