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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Contributor
Posts: 20
Registered: ‎04-19-2010
My Device: supporting 4.6 upwards
My Carrier: any
Accepted Solution

How to localize a library?

I have a library which provides a common code base for several applications. This library provides UI components and similar textual content related components used by the applications, so it has to use locale resources.

 

So this library needs access to its associated *.rrh/*.rrc files to compile properly. So far everything is working properly.

 

But a library may provide default messages, it should not impose limits for the supported locales or the preferred wording for a specific application. What I want to do is, to allow the application to "overwrite" the locale resources of a library. (Not really overwriting, since it would be enough to separate the default and the specific languages.)

 

I tried to leave only the *.rrh and default language *.rrc files in the library and put the *_en.rrc/*_de.rrc files in the application project. This leads to "*.rrh file not found" messages. If I copy the *.rrh file also into the application project, it leads to -- not really surprising -- "duplicate definition errors.

 

I didn't find any information on how that is supposed to work, even though in my opinion this concept doesn't seem to be so far fetched.

 

So, if somebody could give some hints for me to resolve this issue, I would appreciate any help. :-)

Thanks in advance.

Senior Software Engineer
Lindenbaum GmbH
http://www.lindenbaum.eu/
Developer
Posts: 516
Registered: ‎07-23-2010
My Device: 9900

Re: How to localize a library?

Are you using JDE or Eclipse?

Contributor
Posts: 20
Registered: ‎04-19-2010
My Device: supporting 4.6 upwards
My Carrier: any

Re: How to localize a library?

I'm using IntelliJ with BB-Ant-Tools and Eclipse with the current plugin. IntelliJ for the "real coding" and Eclipse for creating the resource bundles and launching the simulator.

 

I have setup my projects in the way that the plugin understands the project structure ("Library" and "Application" projects, dependencies, etc.) so I can build in Eclipse without Ant und run the simulator.

 

The Ant build uses it's own directories for building and storing the distributables, so the two build processes don't interfere with each other.

Senior Software Engineer
Lindenbaum GmbH
http://www.lindenbaum.eu/
Developer
Posts: 17,026
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to localize a library?

this is not possible in the way you are thinking now.

you could add optional methods to the classes in question, like setMessage(newString), to customize the strings.

----------------------------------------------------------
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
Contributor
Posts: 20
Registered: ‎04-19-2010
My Device: supporting 4.6 upwards
My Carrier: any

Re: How to localize a library?

Hmmm, yes, I suspected that... My "plan B" is based on injecting the required information. I just hoped I had overseen something, so I could avoid the refactoring...

 

Thanks so far!

 

 

Senior Software Engineer
Lindenbaum GmbH
http://www.lindenbaum.eu/