Advanced Customization > Services and Infrastructure Customization > Internationalization and Localization > Resource Info (.rbInfo) Files
  
Resource Info (.rbInfo) Files
wt.L10N.complete
Resource Info files are an alternative to storing localizable text in ListResourceBundle source code files. They are structured properties files that facilitate easy manipulation by automated tools.
Resource info (or rbInfo for short) files are resource files used to store localizable strings of Java programs. The primary purpose of the rbInfo files is to provide an easier and more manageable way to handle localizable strings than resource bundles. RbInfo files offer a number of advantages over resource bundles:
Resource bundle files are Java source files, so that a single misplaced curly bracket, missing double quote or extra comma will cause a syntax error and break the compile and integration process. RbInfo files have much simpler format, it is easier to localize and more difficult to introduce syntax errors.
Because of the simpler format of the rbInfo files, it is easier to handle them with localization tools; perform change tracking, change propagation and so on.
It is more difficult to abuse the rbInfo file format and introduce ’tricky’ resource types. Java resource bundles can hold any type of objects, but rbInfo files can handle strings only. (This may appear to be a limitation, but it is not. It makes localization easier.)
RbInfo files are converted to compiled Java class files in the integration process, so that the same naming convention rules apply to rbInfos as resource bundles. (Localized versions are kept in separate files; there is one resource file per language, the name of the locale is appended to the name of the localized files.)
The format of the rbInfo files is PTC-specific. It was designed primarily for Windchill, but can be used in other Java-based products as well. The migration from resource bundles to rbInfo files is seamless; there is no need to change the source code. Old resource bundles can be converted to rbInfo format using a relatively straightforward process. To find out more about the migration, refer to the Windchill Upgrade and Migration Guide.
Resource Info Categories
Localizable text is considered to be in one three categories for the purpose of resource info file usage.
Resource Type
Source File
Run-Time File
Message Text
*RB.rbInfo*Resource.rbInfo
*RB.class*Resource.class
Modeled Metadata(Display Names)
<package>ModelRB.rbInfo
<package>ModelRB.RB.ser
EnumeratedType Options Definition
<EnumType>RB.rbInfo
<EnumType>RB.RB.ser
General Resource Info File Usage Rules
A line beginning with ’#’ is considered a freeform comment.
Each file must contain a header line that categorizes the file.
Only String values are supported.
Since values are assumed to be Strings, they should not be in quotes.
Each entry must exist on a single line, and the following escaped characters are supported: \\, \n, \r, \t, \f, \".
Key cannot contain ’=’, since it is the key/value separator.
Key cannot contain "#", since it is a comment character, but the character is allowed in the value.
Resource Entry Format
The following keys define the structure of resource entries.
Key
Description
Usage
<key>.value
The localizable text that will be displayed.
Required
<key>.constant
A string that will be used to generate a constant field into the runtime resource bundle, which can be used by code that does resource lookups.
Message text: Optional
Metadata: Unused
EnumeratedType: Unused
<key>.comment
A comment describing the entry.
Optional
<key>.argComment<n>
A comment for each substitution argument of the value string.
Optional
<key>.customizable
Indicates whether the resource entry is customizable.
Optional
<key>.deprecated
Indicates (to the developer) whether the resource entry is deprecated.
Optional
<key>.abbreviatedDisplay
Reserved for future use.
Unused
<key>.fullDisplay
Reserved for future use.
Unused
<key>.shortDescription
Reserved for future use.
Unused
<key>.longDescription
Reserved for future use.
Unused
<key>.order
Explicit sort order for the value, unused for alpha ordering.
Message text: Unused
Metadata: Unused
EnumeratedType: Optional
<key>.defaultValue
Specifies the value is the default value for the Enumerated Type.
Message text: Unused
Metadata: Unused
EnumeratedType: Optional
<key>.selectable
Specifies if the value should be allowed to be selected.
Message text: Unused
Metadata: Unused
EnumeratedType: Optional
Resource Info File Descriptions by Category
Message Text
The Message Text category most commonly contains error messages and labels for user interface actions, but is the general category for any localizable text that does not fall into one of the other categories. The Message Text files are completely user-maintained, while the maintenance of the entries in the other two categories is automated via various generation tools. Since this category is not maintained by automated tools, and since the resulting run-time bundle is the same ListResourceBundle subclass that it would be if the information were stored in a ListResourceBundle source code file, the use of .rbInfo file format is optional for Message Text.
The following sections describe the resource info files for Message Text.
Message Text Resource Info Header
Each resource info file must contain the following lines that define certain file level information.
ResourceInfo.class=wt.tools.resource.StringResourceInfo
ResourceInfo.customizable=false
ResourceInfo.deprecated=false
The first line classifies the resource info and should never be changed. The values of the second and third lines can be changed by the owner of the package, if the file can be customized, and/or the file is deprecated.
Message Text Resource Entry Examples
//Labels

lblAdministrative.value=Administrative
lblAdministrative.constant=LBL_ADMIN
lblAdministrative.comment=administrative ui label

lblAllGroups.value=All Groups
lblAllGroups.constant=LBL_ALL_GROUPS

//Button Labels
btnAdd.value=Add>>
btnAdd.constant=BTN_ADD
btnAddAll.value=Add All>>
btnAddAll.constant=BTN_ADD_ALL

//MultiList column headings
Class.value=Class
Created On.value=Created On
Modeled Metadata (Display Names)
Resource Info files for modeled metadata are generated by the Windchill System Generation Tool.
EnumeratedType Options Definition
Resource Info files for enumerated types are described in Enumerated Types .
Building Runtime Resource Bundles for Resource Info Files
Since the information is not stored in Java source code files, a tool other than the Java compiler is needed to build the runtime resource bundles. This tool can be executed by using the ResourceBuild script.