Change resource files
Use the resource editor to define all the text resources that you want to localize in your applications, such as field labels, menu items, and dialog boxes.
The resource editor has a tab along the bottom for each supported locale, based on the .rrc files that you create and add to projects in this workspace.
Each row defines a single resource. The Key column displays a descriptive key for the resource. The Value column displays the text for this resource in a particular locale.
Add a resource to a project
- Double-click the .rrh or .rrc file for the appropriate resource bundle.
- In the resource editor, click the Root tab.
- In an blank Key cell, type a resource key name using uppercase letters.
This is the key that you use in your application code to retrieve this resource.
When you add a resource key to one locale, or to the Root locale, it is available in all locales automatically.
- In the Value cell, in the same row as the new resource key, type the text string for the default locale.
When you add a value to an English locale (for example, en), it is added to all other English locales in your application (for example, en_GB).
Note: If the Value column does not appear when you open a resource header file in the BlackBerry® IDE, create resource content files for the resource bundle.
You can also type unicode directly in the Value cell. For example, to create the word résumé, in the Value cell, type r\uØØE9sum\uØØE9. Visit the unicode web site for more information.
- Click the appropriate tab for each additional locale. In the Value cell for each resource, type the text string for this locale.
When the value is not defined for a resource in a particular locale, the value for the default locale is used.
Display unicode fonts in the resource editor
Modify the resource key
- In the resource editor, right-click a resource, and then click Properties.
- For the resource selected, in the Key field, type a new name.
You should use uppercase letters only for resource keys.
Applications use the resource key to retrieve the resource. If you change the resource key, you must also update the application code.
- Click OK.
As you add new descriptive keys, or make changes to existing descriptive keys, the compiler checks their validity. A warning message appears if the compiler identifies a new or changed key as invalid.
For keys with multiple values, in the resource editor, right-click the resource, and then click Convert to Multiple Values. For the resource that is selected, the resource editor converts the single value in the Value cell to a list of multiple values in all resource files.
Change the package name
Click Options. In the Resource package field, type the package name. For example, com.mycompany.resources.myapp.
Delete a resource from a single locale
Delete a resource from all locales
> On any tab of the resource file, right-click the row for the resource, and then click Delete Value from All.
Set a localized application title
- Using the resource editor, add a resource for the application title, such as APPLICATION_TITLE. Type a value for this resource in the root locale and each locale that you support.
- To display the localized application title on the BlackBerry® device Home screen, set resource title options on the Resources tab of the Project Properties dialog box.
If you do not provide a resource for the application title, then the Title field on the General tab of the Project Properties dialog box is used.
Related topic