[Glade-users] internationalized/locale sensitive widget layout



Andy Tai wrote:

Hi, what is the best way to handle widget layout that may be sensitive to
the locale?  That is, how can I use glade to support a GUI that would
normally show the same widgets with different text under different 
languages
(as output by gettext) but I may want to show some specific widgets at
certain part of the GUI if the locale is a specific one, like say,
Chinese...

Glade natively supports translations in glade files (note that they
must be marked as "translatable"... you can set this in the editor and
even provide a note for the translators).

your glade file should then be called "myproject.glade.in" and you 
Makefile.am
should contain the @INTLTOOL_XML_NOMERGE_RULE@... (I think that is the 
one)...
this rule (and adding it to a list in your po directory ofcourse) will 
provide you with
the proper po files, without doing the actuall translation in the glade 
file...
you should then set your domain through the libglade api when doing the 
parse.

and voila ! you have translatable glade UIs !

if you want to do per-locale widgets... you will have to consult the 
locale and show/hide
them yourself.


Cheers,
                    -Tristan




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