[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk-devel
Subject:    Re: i18n of app menus
From:       Matthias Clasen <matthias.clasen () gmail ! com>
Date:       2012-01-24 0:36:43
Message-ID: CAFwd_vD7s2+w96QhXVtiY_6vu3fAAvC3QB3FpBpp1FsvoRiqXw () mail ! gmail ! com
[Download RAW message or body]

On Mon, Jan 23, 2012 at 2:05 PM, Xan Lopez <xan@gnome.org> wrote:

>> And attribute elements can have the translatable attribute, so
>> we really ought to be writing this like this:
>>
>>  <item action='app.new' accel='&lt;Primary>n'>
>>    <attribute name='label' translatable='yes'>_New Window</attribute>
>>  </item>
>>
>> And then we can use intltool's glade mode and not do terrible hacks
>> to our XML files.

I've tried this now, and (after pushing a fix to gio) I've actually
seen translations show up in my app menu.
There's two things you need to do:

1. put domain='yourdomain' on the <interface> element (or set the
domain manually on the GtkBuilder)
2. Use the <attribute> syntax for translatable strings, as Shaun said

Unfortunately, there's an extra twist to 2. You need to use strict
GVariant syntax for the string, which means you end up with

    <attribute name='label' translatable='yes'>'_New Window'</attribute>

The extra '' are pretty much guaranteed to confuse the heck out of our
translators. We are currently considering some
tweaks to the xml format and the way it is integrated into GtkBuilder
to avoid this problem.
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic