Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
dongfp0609
Posts: 45
Registered: ‎01-18-2013
My Device: 9000
Accepted Solution

how to localization?

hi,everyONE:

 

I have a problem with my program localization. Ifollowed 

http://supportforums.blackberry.com/t5/Cascades-Development/Localization-Question/td-p/2071013/highl...

 

The following is my steps:

1   in bar-descriptor.xml add my languages   -chinese

 

2   build the project and create "Test1_zh-CN.ts" and "Test1_zh-CN.qm" files in translations folder.

 

3  change "Test1_zh-CN.ts" like this:

    <message>
        <location filename="../assets/main.qml" line="31"/>
        <source>Tab 1 title</source>
        <translation>标题1</translation>
    </message>

4  Insert code in main function

 

    QTranslator translator;
    QString locale_string = QLocale().name();
    QString filename = QString( "Test1_%1" ).arg( locale_string );
    if (translator.load(filename, "app/native/qm")) {
        app.installTranslator( &translator );
    }

 After these steps,I tried but it didn't work.Where is the problem? Also anything less?

Thanks a lot!!

 

Please use plain text.
Developer
dongfp0609
Posts: 45
Registered: ‎01-18-2013
My Device: 9000

Re: how to localization?

 

I found a strange phenomenon:When I add  french,it works,but Chinese didn't!!

Why???

Please use plain text.
Developer
ekke
Posts: 1,538
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: how to localization?

how did you add the localization ?

 

try using QtLinguist

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.