Localizing BlackBerry device applications
7
Multilanguage support
The BlackBerry® Integrated Development Environment includes a resource mechanism for creating string resources. The
Localization API is part of the
net.rim.device.api.i18n
package. MIDP applications do not support localization.
TheBlackBerry Integrated Development Environment stores resources for a locale in a
ResourceBundle
object. A
ResourceBundleFamily
object contains a collection of
ResourceBundles
, which groups the resources for an
application. The application can switch languages, depending on the locale of the BlackBerry device user, without requiring new
resource bundles.
You can use the BlackBerry Integrated Development Environment to compile each resource bundle into a separately compiled .cod
file. You can load the appropriate .cod files onto BlackBerry devices with the other .cod files for the application.
Resources are organized in a hierarchy based on inheritance. If a string is not defined in a locale, a string from the next closest
locale is used.
Files required for localization
File required for
localization
Description
Example
Resource header file
This file defines descriptive keys for each localized string. When the
BlackBerry® Integrated Development Environment builds a project, it
creates a resource interface with Resource appended to the .rrh file
name. For example, if you create
AppName.rrh
, the interface is
named
AppNameResource
.
AppName.rrh
Resource content file
(root locale)
This file maps resource keys to string values for the root (global) locale.
It has the same name as the resource header file.
AppName.rrc
Resource content file
(specific locales)
This file maps resource keys to string values for specific locales
(language and country). Files have the same name as the resource
header file, followed by an underscore (_) and the language code, and
then, optionally, an underscore (_) and country code.
AppName_en.rrc
AppName_en_GB.rrc
AppName_fr.rrc
Development Guide
Localizing BlackBerry device applications
78