Troubleshooting guide
243
16: Localizing applications
Manage resource files for application suites
When creating a suite of applications, organize the resources into separate projects for each locale.
Task Steps
Create resource projects. 1. Open the BlackBerry® Integrated Development Environment.
2. Create a project for each resource bundle (locale), including the root locale.
3. Give the projects for each locale the same name as the project for the root locale, followed by
a double underscore (__), the language code, and, optionally, an underscore (_) followed by
the country code.
For example, if the root locale project is named com_company_app, the projects for each
locale would be named com_company_app__en, com_company_app__en_GB, and
com_company_app__fr.
Specify output file names. The output file names for all resource locale projects must be the same as for the root locale,
followed by a double underscore and the appropriate language and country codes.
1. Right-click the project, and then click Properties.
2. On the Build tab, in the Output file name field, type a name for the compiled file, without a
file name extension.
Create an initialization file. > The BlackBerry IDE provides a built-in initialization mechanism, so that you only need to
create an empty initialization class with an empty
main().
package com.rim.samples.device.resource;
import net.rim.device.api.i18n.*;
public class init {
public static void main (String[] args) { }
}
Add files to appropriate resource
projects.
If you support a large number of locales, create a single library project for all resource header (.rrh)
files and set the project type to Library. For each resource locale in this project, define a
dependency between the projects.
1. Create one .rrh file for each application.
2. Add the .rrh files to the project for each application.
3. Add the .rrh files to each resource project.
4. Create one resource content (.rrc) file for each application.
5. Create one .rrc file for each supported locale.
6. In each resource project, right-click each .rrh file, and then click Properties.
7. Select Dependency only. Do not build.
8. Add the .rrc files to the projects for the appropriate locales.