C H A P T E R 2 0
Localizing Newton Applications
Using the Localization Features of the Newton
Defining a Localization Frame
You define the alternative language frames with the
function in a text file included in the project. Here is an example:
"Söker efter ^0...",
// "Searching for ^0..."
. . .}},
"Recherche dans ^0...",// "Searching for ^0..."
. . .}}
When the Language setting in the Project Settings dialog box is English, NTK uses
the string included in the code itself ("Searching for name"). When the Language
setting is Swedish, NTK looks for the string contained in the slot
in the language frame.
You can place other kinds of objects in localization frames. For example, suppose
that you have an integer value that varies by language:
To avoid name collisions, it's a good idea to use at least one extra naming level,
such as in the first example, which uses
. You can set up data objects in as
complex a hierarchy as you need within the language frame.
Using LocObj to Reference Localized Objects
function takes two parameters:
A string or other object; this is used in the English-language version of the