Localizing AIR 2.0 Applications in DreamweaverProducts affected
What's covered
Application Name and Description
The AIR 2.0 Localization Framework
Resource Bundles
Using Localized Strings
Learning More
Adobe AIR 2.0 supports localized applications and Dreamweaver developers can support this exciting new feature. The Dreamweaver AIR Authoring extension does not directly support this feature. The information below will assist you in adding support for multilingual applications to existing Dreamweaver AIR projects.
First, we recommend you read the official documents on Localizing AIR Applications. These documents provides an overview of the AIR 2.0 localization support at a framework level.
Application Name and Description
Dreameaver's application descriptor file interface can only specify one language. Modify the generated XML descriptor file to add the appropriate strings for supported locales to allow Dreamweaver to specific multiple languages. Wrap the current string in the application descriptor file in an XML element that specifies the language. Add additional supported locale strings to provide support for multiple languages.
An English name string would generated as follows:
<name>Sample 1.0</name>Modifed the XML to support multiple languages as follows:
<name> <text >Sample 1.0</text> <text >Enchantillon 1.0</text> <text >Stichprobe 1.0</text> </name>Specify alternate region strings for the application <description> string in the same fashion.
AIR 1.1 Localization Framework
The AIR 2.0 SDK includes an HTML localization framework. This is defined in a JavaScript file, AIRLocalizer.js, in the frameworks directory of the AIR SDK. This file includes the air.Localizer class, which provides functionality to assist in creating applications that support multiple localized versions. Including the AIRLocalizer.js file in the main HTML file of your project, provides access to locale-specific strings for your application, which are maintained within Resource Bundles.
Resource Bundles
A localization file is a collection of key-based values, serialized in a text file. These files are accessed by the AIR 2.0 localization framework to provide locale-specific strings. A localization file is sometimes referred to as a bundle. Within a root-level bundles directory, locale-specific directories are created, housing individual resource files that contain the appropriate locale-specific strings. These resource files are saved with the extension ".properties" and contain key-value pairs defining application strings, for example:
title=Sample Application greeting=Hello in English.These files are saved as simple text files, and contain one key/value pair per line.
Using Localized Strings
AIR 2.0 applications can update elements in the current DOM with their locale-specific values in the appropriate resource bundle by using the following syntax:
<p local_innerHTML="default.greeting" />This example would insert the "greeting" string from the "default.properties" file in the appropriate locale-specific resource bundle. It is also possible to refresh both the entire DOM as well as individual elements to reload strings from either the current, or an alternate locale.
Learning More
This is just a brief overview of the localization framework included within AIR 2.0. Although Dreamweaver does not directly support visual authoring of localized content or strings in AIR 2.0, you can still use the Dreamweaver Extension for AIR to manage, preview, debug and package your localized AIR 2.0 applications.
For specifics on localizing AIR 2.0 applications, please refer to Developing Adobe AIR 2.0 Applications with HTML and Ajax.
Doc ID
(kb403908)
Last updated
2010-08-10
Products affected
