Manage localization files for a suite of BlackBerry device applications
If you create a suite of
BlackBerry®
device applications, organize resources into separate projects for each locale. The
BlackBerry® Integrated Development Environment provides a built-in initialization mechanism. You only need to create an empty initialization class with an empty
main(). 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 the library, define a dependency between the projects.
- Open the BlackBerry® Integrated Development Environment.
- Create a project for each resource bundle (locale), including the root locale.
- Give the projects for each resource 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.
- Right-click the project, and then click Properties.
- 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.
package com.rim.samples.device.resource;
import net.rim.device.api.i18n.*;
public class init {
public static void main (String[] args) { }
}
- Create one resource header file for each BlackBerry
device application.
- Copy the resource header (.rrh) files to the project for each BlackBerry
device application.
- Copy the resource header files to each resource locale project.
- Create one resource content file for each BlackBerry
device application.
- Create one resource content file for each supported locale.
- In each resource locale project, right-click each .rrh file, and then click Properties.
- Select Dependency only. Do not build.
- Add the resource content (.rrc) files to the projects for the appropriate locales.
Index
Was this information helpful? Send us your comments.