beautypg.com

Use custom language detection, Xml file format, About the xml file format – Adobe Flash Professional CS3 User Manual

Page 292: Xliff examples

background image

FLASH CS3

User Guide

286

Note: The ActionScript code that the Strings panel generates does not use the

Locale.initialize

function. Decide

how to call this function based on the language detection customizations your project requires.

Use custom language detection

To access the language XML files to control text replacement at a time that you designate, create your own custom
component or use ActionScript code. For example, you might create a pop-up menu that lets users select a language
for viewing content.

For information on writing ActionScript code to create custom language detection, see About the Strings panel in
Learning ActionScript 2.0 in Adobe Flash.

1

Select Window > Other Panels > Strings, and click Settings.

2

In the Default Language menu, select the default language.

This must be a language you added as an available language.

3

Select the Replace Strings Via ActionScript check box, and click OK.

Flash generates the following ActionScript code, which stores the language XML file paths. Use this code as a starting
point for your own language detection script.

import mx.lang.Locale;

Locale.setFlaName("");

Locale.setDefaultLang("langcode");

Locale.addXMLPath("langcode", "url/langcode/flaname_langcode.xml");

Note: The ActionScript that the Strings panel generates does not use the

Locale.initialize

function. Decide how to

call this function based on the language detection customizations your project requires.

XML file format

About the XML file format

Exported XML is in UTF-8 format and follows the XML Localization Interchange File Format (XLIFF)1.0 standard.
It defines a specification for an extensible localization interchange format that lets any software provider produce a
single interchange format that can be delivered to, and understood by, any localization service provider. For more
information about XLIFF, see

www.oasis-open.org/committees/xliff/

.

XLIFF examples

If any of the following characters are entered in the Strings panel, they are replaced by the appropriate entity reference
when written to XML files:

Character

Replaced by

&

&

'

'

"

"

<

<

>

>