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
Contributor
webbasan
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/
Please use plain text.
Developer
BB-Dude
Posts: 516
Registered: ‎07-23-2010
My Device: 9900

Re: How to localize a library?

Are you using JDE or Eclipse?

Please use plain text.
Contributor
webbasan
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/
Please use plain text.
Developer
simon_hain
Posts: 15,947
Registered: ‎07-29-2008
My Device: Z10 LE
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
Please use plain text.
Contributor
webbasan
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/
Please use plain text.