File required for
localization
Description
Example
Save resource content files in the folder where the .java file is located.
For example, in the folder that contains CountryInfo.java, save
CountryInfo.rrc (root locale), CountryInfo_en.rrc (English), and
CountryInfo_fr.rrc (French).
Initialization file
This file initializes the resource bundle mechanism. You require this file
only when you compile resources as a separate project.
init.java
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.
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 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
.
4.
Right-click the project, and then click
Properties
.
5.
On the
Build
tab, in the
Output file name
field, type a name for the compiled file, without a file name extension.
6.
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) { }
}
7.
Create one resource header file for each BlackBerry device application.
8.
Copy the resource header (.rrh) files to the project for each BlackBerry device application.
9.
Copy the resource header files to each resource locale project.
10. Create one resource content file for each BlackBerry device application.
11.
Create one resource content file for each supported locale.
12. In each resource locale project, right-click each .rrh file, and then click
Properties
.
13. Select
Dependency only. Do not build
.
Development Guide
Manage localization files for a suite of BlackBerry device applications
79