If you have chosen to create Unicode-encoded files, you must install the JDK first. You will use the JDK's native2ascii utility program to convert native encoding to Unicode. For more information about this utility program, see http://www.javasoft.com/products/jdk/1.2/docs/tooldocs/win32/native2ascii.html.
Next, follow these steps in VisualAge:
SomeClass class>>#abtExternalizedStringBuildingInfo ^Array with: 'ULC?R40' "MPR filename without extension; use yours here" with: false "NOT platform dependent" with: true. "DO recurse subApplications"
The question mark (?) in the file name is a placeholder for the locale strings mapped in #initializeUlcSystemNLSMappings later in this process.
Important: Skip this step if you do not wish to use Unicode or if the default language environment is Latin-1 (code page 850 or ISO 8559-1).
For example, the following syntax converts a Japanese input file to Unicode:
native2ascii -encoding Cp942 input.tra output.tra
SomeClass class>>#initializeUlcSystemNLSMappings UlcSystem default nlsMapDefault: 'en' to: UlcNlsFileEnglish; nlsMappings: ( LookupTable new at: 'en' put: UlcNlsFileEnglish; at: 'de' put: UlcNlsFileGerman; yourself)
In this method, the ISO language code de is mapped to the string specified in UlcNlsFileGerman. This string is substituted into the name of the MPR file established for a German locale in the #abtExternalizedStringBuildingInfo method.
loaded UlcSystem isRuntime ifTrue: [self initializeUlcSystemNLSMappings]. UlcSystem registerApplicationNamed: 'MyUlcApp' withStartupClass: SomeClass
For more information on registration during startup, see Registering the ULC visual application class.
UlcAlert is the only class shipped with ULC that uses string resources according to this scheme. The abstract MPR file name is ulcwi?40. Its language-to-file-name substitution mappings follow the standard values described in the VisualAge User's Guide. To implement a different mapping, adjust the definitions for the widget strings to match those of the application.
The language mappings shipped with ULC correspond to those languages for which a national language version of VisualAge is available, with the addition of German. For any other languages, you must include TRA and MPR files. The names and scripts for their generation can be found in the UlcWidgetApp class categorized under ULC-Internal-NLS Support.