[Kde-games-devel] Game introduction: Nonogram

Ian Wadham ianw2 at optusnet.com.au
Wed May 14 12:03:19 CEST 2008


On Wed, 14 May 2008 04:43 pm, Tom Vollerthun wrote:
> In the example at:
> http://techbase.kde.org/Development/Tutorials/Localization/i18n_Challenges#
>Translating_Data I can't see, where the correct locale is determined. In
> line 1 there's already a "languageCode" given, but where does it come from?
>
Normally I think the language comes from the user's installation settings,
e.g. "de" for German and "Name[de]=..." is looked up at execution time
when you ask for "Name=..." (???).  I am rather vague on this stuff, being
an English speaker ... ;-)  In this example, I think an alternate language is
being sought.

> It seems as if /kdesdk/scripts/extractattr is able to extract strings from
> generic xml-files as long as it's given the complete XPATH via --attr. So
> an xml-file seems feasible.
>
Sure.  I steered away from it because I had hundreds of lines of hints and
quirky game names and I thought I might want to use embedded HTML
one day (as in Qt's Rich Text facility) and I also did not want to pre-process
the text to put in escape strings everywhere to avoid anything else that
might remotely look like XML special-characters.  But if your strings are
short and "plain", then XML could be good.  There are classes in Qt to
parse it.

> It seems to me as if all these scripts and exctraction tools exist simply
> to provide a .pot-file which then can be translated. Wouldn't it be easier
> to have the descriptions directly in a pot-file and simply load the
> approbriate .po (plus the .pot as default) at runtime?
>
I think i18n() does something like that.  Again I am a bit vague on that.

Cheers, Ian W.


More information about the kde-games-devel mailing list