EDOBE XDOM TAKE 6 IR - PRODUCTSHEET Especificações Página 225

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 304
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 224
CHAPTER 8: ExtendScript Tools and Features Localizing ExtendScript strings 225
To use automatic translation of localization objects, you must enable localization in your script with this
statement:
$.localize = true;
The localize function always performs its translation, regardless of the setting of the $.localize
variable; for example:
msg = { en: "Yes", de: "Ja", fr: "Oui" };
//Only works if the $.localize=true
alert (msg);
//Always works, regardless of $.localize value
alert ( localize (msg));
If you need to include variables in the localized strings, use the localize function.
Locale names
A locale name is an identifier string in that contains an ISO 639 language specifier, and optionally an ISO
3166 region specifier, separated from the language specifier by an underscore.
X The ISO 639 standard defines a set of two-letter language abbreviations, such as en for English and de
for German.
X The ISO 3166 standard defines a region code, another two-letter identifier, which you can optionally
append to the language identifier with an underscore. For example,
en_US identifies U.S. English,
while
en_GB identifies British English.
This object defines one message for British English, another for all other flavors of English, and another for
all flavors of German:
message = {
en_GB: "Please select a colour."
en: "Please select a colour."
de: "Bitte wählen Sie eine Farbe."
};
If you need to specify different messages for different platforms, you can append another underline
character and the name of the platform, one of
Win, Mac, or Unix. For example, this objects defines one
message in British English to be displayed on Mac OS, one for all other flavors of English on Mac OS, and
one for all other flavors of English on all other platforms:
pressMsg = {
en_GB_Mac: "Press Cmd-S to select a colour.",
en_Mac: "Press Cmd-S to select a color.",
en: "Press Ctrl-S to select a color."
};
All these identifiers are case sensitive; for example, EN_US is not valid.
How locale names are resolved
1. ExtendScript gets the hosting applications locale; for example,
en_US.
2. It appends the platform identifier; for example,
en_US_Win.
3. It looks for a matching property, and if found, returns the value string.
4. If not found, it removes the platform identifier (for example,
en_US) and retries.
Vista de página 224
1 2 ... 220 221 222 223 224 225 226 227 228 229 230 ... 303 304

Comentários a estes Manuais

Sem comentários