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

Java Development

Reply
Developer
sandeepkumar03
Posts: 117
Registered: ‎02-12-2009
My Device: Not Specified
Accepted Solution

Localizing App on JDE

Hi All,

 

I have gone through the tutorial to localize . But i this contains the steps for localizing on Eclipse. I have tried it and it works fine. But on JDE i am little confused. If some one can help me on JDE. 

 

I can create a Language Resource by using  New -> Project -> Language Resource. For example i created in package com.company.blackberry.samplelocalizedapp. In this i have .rrh and .rrc files. Now i am not sure if i can add my application code here and go on.

 

But other way round, I already have a project say HelloWorldApplication in package com.company.blackberry.HelloWorldApplication. I don't find a way to create resource files here. Also i can't create a Language Resouce in package com.company.blackberry.HelloWorldApplication, asi have already another project with same name. And Language Resource name must match project. Can't we do it similar to Eclipse at one go in same project. As eclipse gives option to create new Resource file instead of Resource Project (I hope this makes sense).

 

One more thing, i am not sure what is the reason for LanguageResourceInterface to keep it invisible. We have to extract JAR. I thought we have to decompile the Language Resource project, create a Interface for second project by copying code from decompiled file. And copy the resources to project. But i dont think this is the right approach.

 

Or can we create the project as Language Resource itself and then add our application code?

 

I am sorry if i sound confused, but please help me understanding this clearly.

 

I had posted this earlier but couldn't figure out, so posting it again as per Mark Sohm's instructions (Not to put question in solved thread)

 

Thanks,

Sandeep

Please use plain text.
Developer
mantaker
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Localizing App on JDE

I really don't have experience with resource file .. But I know that adding or editing a resource file can be done by right clicking the project-> new -> other or just ctrl+n .. Expand the + mark at the Blackberry then choose Blackberry Resource file ... Then edit as you wish..

 

Cheers..

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Please use plain text.
Developer
sandeepkumar03
Posts: 117
Registered: ‎02-12-2009
My Device: Not Specified

Re: Localizing App on JDE

Hi Mantaker,

 

Thanks for reply. But i guess you are mentioning the steps on Eclipse. As most of time I was using Blackberry JDE. I was looking for similar steps in Blackberry JDE.

 

In JDE, I tried New File -> Other ->  HelloWorldApplication.rrc. Here rrh file is automatically generated in the project folder, but isn't visible in JDE project tree. So i added the files manually. Now when i double click rrc or rrh file. I get error Encountered ".4" at line 1, column 56. Was expecting one of ";" "."

 

I am not sure whts the issue here.

 

Thanks,

Sandeep

Please use plain text.
Developer
mantaker
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Localizing App on JDE

Though I have never worked on a localization stuff as I already mentioned, the equivalent for the above post by me in JDE must be File->New->Projects->Language resource I suppose..

 

Cheers.. 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Please use plain text.
Developer
simon_hain
Posts: 16,137
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Localizing App on JDE

mantaker is correct, you have to create the resource files with the JDE.
they use a special java format, if you want to edit them by hand you can do so with prbeditor https://prbeditor.dev.java.net (just rename them to properties, edit them and rename them back).

i don't use the eclipse plugin (but develop in eclipse), this is what i do:
- create a resources package
- create a new Language Resource file by clicking File->New->Projects->Language resource
- a wizard opens where you can add languages, in the end the language files are created
- create an interface in eclipse with a long BUNDLE_ID and a String BUNDLE_NAME. It contains int constants with the same name as the language file. the value is not important (=0 is sufficient). this file is not used by the JDE/rapc, it is only to trick eclipse.
(you can skip this step if you develop in the JDE. please apply with the local therapist and at least try a decent development environment)
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
simon_hain
Posts: 16,137
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Localizing App on JDE

some additional information that may be useful (together with a small anecdote):

language resource files are saved in a special java format. i did not find any useful links about it on a quick search.
to edit them outside the JDE, for example if you get the translation from an external translator, you can use special tools to edit them.
i used prbeditor (https://prbeditor.dev.java.net) successfully, all you have to do is rename the extension to properties (and back when you are finished).

on to my little anecdote:

for one of my applications i got translations in different languages, one of them turkish.
because it should be shown on a trade fair in istanbul the next day i tried to integrate it quickly.
i did not want to copy all 300+ lines and exported it as unicode, formatted it with a few regex and voila, looked fine

two days later my boss returned from istanbul. the unicode conversion had changed the 'i' without a point (a special turkish character) to 'i' with point.

now i learned that the turkish word for 'favorite' is written with a point on the i. the word for the mans member is written without the point.
manage favorites, add to favorites, remove favorite. are you sure?

at least the turkish businessmen took it with a lot of humor that their best part could be managed with the application :smileyhappy:

conclusion:
a small i-dot can make a huge (or not so huge, depending on who you ask) difference!
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.