|
Flash CS4 Resources |
Creating multilanguage textYou can configure a FLA file to display text in different languages depending on the language of the operating system that plays the Flash content. Workflow for authoring multilanguage text with the Strings panelThe Strings panel lets you create and update multilingual content. You can specify content for text fields that span multiple languages, and have Flash automatically determine the content that should appear in a certain language based on the language of the computer running Flash Player. The following steps describe the general workflow: 1. Author a FLA file in one language.Any text to enter in another language must be in a dynamic or input text field. 2. In the Strings Panel Settings dialog box, select the languages to include and designate one of them as the default language.A column for the language is added to the Strings panel. When you save, test, or publish the application, a folder with an XML file is created for each language. 3. In the Strings panel, encode each text string with an ID.4. Publish the application.A folder is created for each language you select, and within each language folder is an XML file for that language. 5. Send the published FLA file and XML folders and files to your translators.Author in your native language and let the translators make the translation. They can use translation software directly in the XML files or in the FLA file. 6. When you receive the translations from your translators, import the translated XML files back into the FLA file.Select and remove languages for translationAs many as 100 languages can appear on the Stage and in the Strings panel for translation. Each language you select becomes a column in the Strings panel. To show the text on the Stage in any of the languages you selected, change the Stage language. The selected language appears when you publish or test the file. When selecting languages, use any of the languages provided in the menu, as well as any other Unicode-supported language. Remove a languageNote: When you remove a language from the Strings panel,
the language XML file is not deleted from the local file system.
This lets you add the language back into the Strings panel by using
the previous XML file, and prevents accidental deletion. To completely
remove the language, you must delete or replace the language XML
file.
Add strings to the Strings panelAssign
text strings to the Strings panel in the following ways:
Assign a string ID to a text field
Note: If a static text field is selected on the Stage, the
Stage text selection section on the Strings panel displays the message
“Static text cannot have an ID associated with it.” If a nontext
item is selected or multiple items are selected, the message “Current selection
cannot have an ID associated with it” appears.
Add a string ID to the Strings panel without assigning it to a text field
Assign an existing ID to a text field
Note: Press Shift+Enter to apply the ID to the text field,
or Enter if the focus is on the ID field.
Editing strings in the Strings panelAfter you enter text strings in the Strings panel, use one of the following methods to edit the text strings:
Enter Asian characters on a Western keyboardWith Flash, you can use Input Method Editors (IMEs) and standard Western keyboards to enter Asian characters on the Stage. Flash supports more than two dozen IMEs. For example, to create a website that reaches a broad range of Asian viewers, you can use a standard Western (QWERTY) keyboard and change the IME to create text in Chinese, Japanese, and Korean. Note: This feature affects only text input
on the Stage, not text entered in the Actions panel. This feature
is available for all supported Windows operating systems and Mac OS
X.
Publishing multilanguage FLA filesWhen 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. Manually replace strings at publish timeManually 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.
Use automatic language detection with the default languageYou 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.
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");
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 detectionTo 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. 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.
|