Publishing multilanguage fla files, Manually replace strings at publish time – Adobe Flash Professional CS3 User Manual

Page 291

Advertising
background image

FLASH CS3

User Guide

285

Publishing multilanguage FLA files

When you save, publish, or test the FLA file, a folder with an XML file is created for each available language you
selected in the Strings panel. The default location for the XML folders and files is the same folder indicated as the
SWF publish path. If no SWF publish path was selected, the XML folder and files are saved in the folder in which the
FLA file is located. For example, if you have a file named Test in the mystuff folder, and you selected English (en),
German (de), and Spanish (es) as active languages, and you did not select a SWF publish path, when you save the
FLA file, the following folder structure is created:

\mystuff\Test.fla

\mystuff\de\Test_de.xml

\mystuff\en\Test_en.xml

\mystuff\es\Test_es.xml

When you start a SWF file, you also need to start the associated XML files with the string translations in the web
server. The first frame that contains text cannot appear until the entire XML file is downloaded.

See also

“Publishing Flash documents” on page 419

Manually replace strings at publish time

Manually replace strings by using the Stage language when you publish your Flash SWF file. This method uses the
Stage language to replace all instances of input and dynamic text with an associated string ID. In this case, text strings
are only updated when you publish the SWF file; language detection is not automatic, and you must publish a SWF
file for each language to support.

1

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

2

Select the Replace Strings Automatically At Runtime check box.

Use automatic language detection with the default language

You can change the default runtime language to any language that you selected as an available language. When
automatic language detection is on, and you view the SWF file on the system that uses the language, any system that
is set to a language other than one of the active languages uses the default language. For example, if you set your
default language to English and you select ja, en, and fr as active languages, users who have their system language set
to Japanese, English, or French automatically see text strings in their chosen language. However, users who have their
system language set to Swedish, which is not one of the selected languages, automatically see text strings in the
default language you selected—in this case, English.

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

To enable automatic language detection, select Replace Strings Automatically At Runtime, and click OK.

4

Flash generates the following ActionScript™, 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("<flaFileName>");

Locale.setDefaultLang("langcode");

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

Advertising