Re: i18n of app menus

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='' 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.

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