EDOBE XDOM TAKE 6 IR - PRODUCTSHEET Spezifikationen Seite 226

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 304
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 225
CHAPTER 8: ExtendScript Tools and Features Localizing ExtendScript strings 226
5. If not found, it removes the region identifier (for example, en) and retries.
6. If not found, it tries the identifier
en (that is, the default language is English).
7. If not found, it returns the entire localizer object.
Testing localization
ExtendScript stores the current locale in the variable $.locale. This variable is updated whenever the
locale of the hosting application changes.
To test your localized strings, you can temporarily reset the locale. To restore the original behavior, set the
variable to
null, false, 0, or the empty string. An example:
$.locale = "ru"; // try your Russian messages
$.locale = null; // restore to the locale of the app
Global localize function
The globally available localize function can be used to provide localized strings anywhere a displayed
text value is specified. The function takes a specially formatted set of localized versions of a display string,
and returns the version appropriate to the current locale.
localize()
localize (localization_obj[, args])
localize (ZString)
localization_obj
A JavaScript object literal whose property names are locale names, and
whose property values are the localized text strings. The locale name is an
identifier as specified in the ISO 3166 standard, a set of two-letter language
abbreviations, such as "
en" for English and "de" for German.
For example:
btnText = { en: "Yes", de: "Ja", fr: "Oui" };
b1 = w.add ("button", undefined, localize (btnText));
The string value of each property can contain variables in the form %1, %2,
and so on, corresponding to additional arguments. The variable is replaced
with the result of evaluating the corresponding argument in the returned
string.
args
Optional. Additional JavaScript expressions matching variables in the string
values supplied in the localization object. The first argument corresponds to
the variable
%1, the second to %2, and so on.
Each expression is evaluated and the result inserted in the variables position
in the returned string.
ZString
Internal use only. A ZString is an internal Adobe format for localized strings,
which you might see in Adobe scripts. It is a string that begins with
$$$ and
contains a path to the localized string in an installed ZString dictionary. For
example:
w = new Window ("dialog", localize ("$$$/UI/title1=Sample"));
Seitenansicht 225
1 2 ... 221 222 223 224 225 226 227 228 229 230 231 ... 303 304

Kommentare zu diesen Handbüchern

Keine Kommentare