[Kde-games-devel] Re: Kde logo for using in about menu

Andreas Beckermann kde-games-devel@mail.kde.org
Mon, 17 Feb 2003 04:06:23 +0100


On Thursday 13 February 2003 23:48, Albert Astals Cid wrote:
> Thanks a lot, finally i decided to use the XMLGUI option, it has been a bit
> difficult to undestand how that XML files work, but i've finally got what i
> wanted.
>
> But now i have another question, i now have a menu like
>
> <MenuBar>
> 	<Menu name="game">
> 		<Action name="mode" />
> 	</Menu>
> 	<Menu name="board"><text>&amp;Board</text>
> 		<Action name="default" />
> 		<Action name="bigger" />
> 		<Action name="smaller" />
> 	</Menu>
> </MenuBar>
>
> The problem is how to add internationalization to the new menu created from
> the XML file (Board), i mean, i am extracting the strings to translate
> using
>
> xgettext -C -ki18n -kI18N_NOOP -o po/kttt.pot board.cpp kttt.cpp main.cp
>
> If i add i18n() or I18N_NOOP to the XML file i don't get what i want (what
> happens is that the menu changes its name)

Since nobody has replied yet...
i18n() and I18N_NOOP are a function / macro which work in source only, not in 
xml.

> So what must i do here?

(please keep in mind: I am not a translater - there are lots of people who 
know more on this than I do)

The standard KDE way is to add "rc.cpp" into the "messages:" target of your 
Makefile.am. Look at your favorite KDE application to see an example :)
you'll see the lines
rcdir=$(kde_datadir/foobar
rc_DATA=foobarui.rc
usually along with that. These lines specify the destination (rcdir) of your 
*ui.rc files (rc_DATA).
AFAIK the rc.cpp is some kind of KDE magic - the translatable files will get 
generated.

So for a "normal" developer there should be no need to do anything special in 
code for i18n support in the *ui.rc XML files.

CU
Andi