02-26-2013 06:19 AM
on iOS programming I think you have concept of String tables. You can have separate tables for different languages (e.g., English, German, etc.). inside it you have keywords like this:
"goodMorning" = "Good Morning!"
in the string table for german you might have same key as:
"goodMorning" = "Guten Morgen!"
then in app I think you can directly use "goodMorning" keyword and depending on the language correct value will be displayed (e.g., either Good Morning or Guten Morgen).
Is there anything similar in Balckberry 10?? I think it should be?? If yes, what... any links/references.. thanks..
02-26-2013 06:23 AM
Yes, there is something very similar...
Its technically called Internationalization Support
02-26-2013 06:51 AM
02-26-2013 07:01 AM
At that link above there's a subpage on translation:
Also this threads contains some helpful information:
Some Qt docs, but they contain mostly the same info:
02-26-2013 07:03 AM
02-27-2013 02:52 AM - edited 02-27-2013 03:17 AM
Hi, thanks for the links they have some info.
But I am still looking for a step by step guide (for beginners maybe?)...
ps. also it seems I don't have lupdate tool on my Mac; I get this error: -bash: lupdate: command not found; where to download it from?? thanks,
02-27-2013 05:15 AM
02-27-2013 06:26 AM
02-27-2013 07:59 AM
For the .ts files to be generated, you need to specify the languages you want in your .pro file, for example, at the end of the file, put:
TRANSLATIONS = \
Not all project templates include that by default from what I have seen.
Then in QML, wrap all strings into:
title: qsTr("My Title")
And in C++ use tr(), as:
When you build, the .ts files will be updated with all the wrapped strings in your app.
You can also have variable that handle the language specific word order using arg() as:
Then you can translate in French for example in the .ts file using:
<translation>il y a %L1 ans</translation>
02-27-2013 08:41 AM
Hi Thanks it seems I had already added following values to the .pro file:
TRANSLATIONS = MyProgram_en.ts \
and also now I see a folder named "translations" and it contains 8 files:
I have also used the tr() keyword at several places in my app but the .ts files seem to look empty, like this:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="en_US"> </TS>
Can you please help? What I maybe doing wrong? Thanks.