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
babakar
Posts: 696
Registered: ‎05-29-2012
My Device: see later
My Carrier: see later

Re: 4 language application

one more question., what if i want to represent data i get from server side..
i wanna represent either in english or french. depending on locale_string.

i send the locale_string..if english bring me english..and if french bring me french????

bt noticed sthg..when i change language in blackberry...automatically language changes in my app too. with server side thing, that wont work.

opinions.
Please use plain text.
Developer
Benecore
Posts: 377
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: T-Mobile

Re: 4 language application

1. This can be possible only if your provider of API support multi language output. For example if can receive argument like url?language=currentlanguage , but i think this does not support many providers. Most of the outputs are in English.

 

2. If you can translate error outputs than you need a conditions and write your own multilanguage outputs. For example

void outputReceived(){
    // 500 = Internal server error
    if (error == 500 /*status code*/){
        showToast(tr("Internal server error"))
    }
    ....
}

 



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Please use plain text.
Developer
babakar
Posts: 696
Registered: ‎05-29-2012
My Device: see later
My Carrier: see later

Re: 4 language application

noticed one thing though

 

i have this

 

<context>
    <name>service</name>
    <message>
        <location filename="../assets/service.qml" line="97"/>
        <source>submit</source>
        <translation>Submit</translation>
    </message>

 

 

but the problem is i have submit button on other pages as well, why should i write it and specify it a million times?

how can i do it common for all pages?

Please use plain text.
Developer
Benecore
Posts: 377
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: T-Mobile

Re: 4 language application

I don't think is this possible. But one little workaround can be (will be :smileywink:) if you create one QML file or C++ class with your Button and define the text.
Then just use it whatever you want without changing text (Sorry my English :Tt2:). After that you will have just one "Submit" text

 



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Please use plain text.
Developer
babakar
Posts: 696
Registered: ‎05-29-2012
My Device: see later
My Carrier: see later

Re: 4 language application

any way we can do it on source file?

 

 ComponentDefinition {
            id: main
            source: qsTr("serviceQML")+Retranslate.onLocaleOrLanguageChanged
        }

 

I did this. So when its english it goes to page1.qml when french goes to page2.qml

 

however if i change the language when he is on page1.qml it doesnt revert automatically to page2.qml

 

can i do it on designs?

on layoutorientation etc etc?

 

I am asking this, cause it wont make diference between english/french...bt for arabic the design will be different.as arabic letters as far as i know start from right to left..rather then left to right

Please use plain text.
Developer
babakar
Posts: 696
Registered: ‎05-29-2012
My Device: see later
My Carrier: see later

Re: 4 language application

how can i  specify in this file sthg like include this source file in this file.. where i use translation.

 

import bb.cascades 1.2

Page {
    Container {
        
    }
}

 

Please use plain text.
Developer
babakar
Posts: 696
Registered: ‎05-29-2012
My Device: see later
My Carrier: see later

Re: 4 language application

is there a way i can revert my pages from being left to right..to right to left?
when goes arabic?
Please use plain text.
Developer
babakar
Posts: 696
Registered: ‎05-29-2012
My Device: see later
My Carrier: see later

Re: 4 language application

i checked facebook app. and they havent modified designs for sake of arabic language
Please use plain text.