Re: i18n of app menus

On Mon, 2012-01-23 at 09:11 -0500, Shaun McCance wrote:
> 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:

So I just read this:

It turns out this:

  <item label='_New Window' action='' accel='&lt;Primary>n'/>

is really shorthand for this:

    <attribute name='label'>_New Window</attribute>
    <attribute name='action'></attribute>
    <attribute name='accel'>&lt;Primary>n</attribute>

or presumably this:

  <item action='' accel='&lt;Primary>n'>
    <attribute name='label'>_New Window</attribute>

And attribute elements can have the translatable attribute, so
we really ought to be writing this like this:

  <item action='' accel='&lt;Primary>n'>
    <attribute name='label' translatable='yes'>_New Window</attribute>

And then we can use intltool's glade mode and not do terrible hacks
to our XML files.


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