XML file format for multilanguage text



When you use multilanguage text in Flash, the text is stored in XML files.

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

&

&

'

'

"

"

<

&lt;

>

&gt;

Exported XML file sample

The following examples show what an XML file that the Strings panel generates looks like in the source language—in this example, English—and in another language—in this example, French:

English source version sample:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE xliff PUBLIC "-//XLIFF//DTD XLIFF//EN" 
"http://www.oasis-open.org/committees/xliff/documents/xliff.dtd" > 
<xliff version="1.0" xml:lang="en"> 
<file datatype="plaintext" original="MultiLingualContent.fla" source-language="EN"> 
        <header></header> 
        <body> 
            <trans-unit id="001" resname="IDS_GREETINGS"> 
                <source>welcome to our web site!</source> 
            </trans-unit> 
            <trans-unit id="002" resname="IDS_MAILING LIST"> 
                <source>Would you like to be on our mailing list?</source> 
            </trans-unit> 
            <trans-unit id="003" resname="IDS_SEE YOU"> 
                <source>see you soon!</source> 
            </trans-unit> 
            <trans-unit id="004" resname="IDS_TEST"> 
                <source></source> 
            </trans-unit> 
        </body> 
    </file> 
</xliff>

French source version sample:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE xliff PUBLIC "-//XLIFF//DTD XLIFF//EN" 
"http://www.oasis-open.org/committees/xliff/documents/xliff.dtd" > 
<xliff version="1.0" xml:lang="fr"> 
<file datatype="plaintext" original="MultiLingualContent.fla" source-language="EN"> 
        <header></header> 
        <body> 
            <trans-unit id="001" resname="IDS_GREETINGS"> 
                <source>Bienvenue sur notre site web!</source> 
            </trans-unit> 
            <trans-unit id="002" resname="IDS_MAILING LIST"> 
                <source>Voudriez-vous être sur notre liste de diffusion?</source> 
            </trans-unit> 
            <trans-unit id="003" resname="IDS_SEE YOU"> 
                <source>A bientôt!</source> 
            </trans-unit> 
            <trans-unit id="004" resname="IDS_TEST"> 
                <source></source> 
            </trans-unit> 
        </body> 
    </file> 
</xliff>

Translate text in the Strings panel or an XML file

When sending files to translators, include not only the FLA file but also the folders for the XML files and the XML file for each language.

Translators can either work directly in the language columns in the Strings panel or work in the XML files for each language to translate the FLA file to selected languages. If you translate directly in the XML file, you must either import the XML file to the Strings panel or save it in the default directory for that language.

Translate text in the Strings panel

  1. Select Window > Other Panels > Strings.
  2. For each language to be translated, select the appropriate language column, then type the translated text for that language to be associated with each string ID.
  3. To show the text on the Stage in the language you selected, select the language in the Stage Language field.
  4. When you are finished, save, publish, or test the file.

    All XML files for all languages are overwritten with the information in the Strings panel.

    Note: To preserve the translation in an XML file, save it in a different folder.

Translate text in an XML file

  1. Using an XML file editor or translating software, open the folder for the desired language, then the XML file for that language. The XML file is populated with the IDs for each text string.
  2. Enter the text string for the language next to the ID.
  3. If necessary, import the translated XML file into the Strings panel.

Import an XML file into the Strings panel

After you modify an XML file, if you place it in the folder specified in the Strings panel for that language, the XML file is loaded into the Flash document (FLA file) when it opens.

Regardless of where the XML file you imported was located, when you save, test, or publish the FLA file, a folder for each language in the Strings panel and an XML file for each language are created in the location indicated for publishing SWF files. If no publish path is indicated, the folder and file are saved in the same folder in which the FLA file is located. The XML files that the Strings panel generates are always populated with the information in the Strings panel.

Alternatively, import an XML file into the Strings panel from another location. After you import it, when you save, test, or publish the file, the XML file in the folder specified for that language is overwritten. You cannot import an XML file for a language unless it is already selected as an available language in the Strings panel. You can also add a language and import an XML file with the translation for that language.

  1. Select Window > Other Panels > Strings, and click Import XML.
  2. In the Select a Language menu, select the language of the XML file you are importing, and click OK.
  3. Navigate to the folder and XML file to import.

    The XML information is loaded into the column in the Strings panel for the language you selected in step 3.

Note: Select the same language in steps 2 and 3. Otherwise, you could, for example, import a French XML file into the column for German.