Apple Newton Utilities Guia do Utilizador Página 736

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 942
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 735
CHAPTER 20
Localizing Newton Applications
20-4 Using the Localization Features of the Newton
Dening a Localization Frame 20
You dene the alternative language frames with the SetLocalizationFrame
function in a text le included in the project. Here is an example:
SetLocalizationFrame({
Swedish: {
find: {
searchFor:
"Söker efter ^0…", // "Searching for ^0…"
. . .}},
French: {
find: {
searchFor:
"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
Swedish.find.searchFor 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:
SetLocalizationFrame({
French: {
languageInt: 1,
},
Swedish: {
languageInt: 2,
},
German: {
languageInt: 3.
}
});
To avoid name collisions, it’s a good idea to use at least one extra naming level,
such as in the rst example, which uses
find. You can set up data objects in as
complex a hierarchy as you need within the language frame.
Using LocObj to Reference Localized Objects 20
The LocObj function takes two parameters:
A string or other object; this is used in the English-language version of the
application.
Vista de página 735
1 2 ... 731 732 733 734 735 736 737 738 739 740 741 ... 941 942

Comentários a estes Manuais

Sem comentários