XML Import / Export

Using the XML file format to import/export content

Within the Localize dashboard we provide you with an ability to import and export phrases and translations in various file formats.

You can also import/export Glossary terms.

To see a general explanation of how importing and exporting works in Localize, click here.

📘

UTF-8 File Format

Be sure that you are using the UTF-8 file format when working with the external files you are creating for importing purposes.

Importing Phrases or Glossary Terms

Before importing, make sure your file adheres to the file requirements below.

Navigate to the File Import / Export: Import tab in your dashboard.

  1. Drag-and-drop a file to import into the box, or select a file to import.
  2. Select XML under File Format.
  3. Select the language you are importing.
  4. Specify the import type: Phrases or Glossary terms
  5. Click the Submit button.
  6. Wait for the file to be uploaded.
  7. Success! View the file details to see how many phrases were created, updated, etc.

Exporting Phrases or Glossary Terms

Navigate to the File Import / Export: Export tab in your dashboard.

  1. Select XML under File Format.
  2. Select a filter which will determine which phrases get exported:
    a. Published translations
    b. Machine translations
    c. Human translations
    d. No translations
    e. Needs human translations
  3. Select the language you are exporting.
  4. Specify the export type: Phrases or Glossary terms
  5. Click the Export button.
  6. Wait for your download to complete, then close the popup dialog.

📘

Exporting Selected Phrases

Alternatively, you can filter exactly which phrases that you want to export on the Phrases page. Find out how...


File Requirements

XML is a format that's used to exchange data between participants in a translation project.
Use the following sample for guidance when creating your XML file for importing into Localize.

The following data is required:

  • <resources> element: parent element of all other elements that follow
  • <source-language> element: the source language code
  • <target-language> element: the target language code
  • <string>: For each phrase ( element):
    • name: this is the source language phrase

The following data is optional for each phrase ( element):

  • id attribute: this internal ID will be seen in any files exported from Localize
  • context attribute: a string which provides context for your translators
  • labels attribute: A comma-separated list of strings which are labels to apply to the phrase
    • Note that any pre-existing labels on the phrase will be replaced by the ones in the import file.
    • Any labels added to the phrase in the file being imported will be added to the Localize dashboard.
  • translation: this will be the contents of the element
    • If present, this is the translation of the source text
<?xml version = "1.0" encoding="UTF-8"?>
<resources>
  <source-language>en</source-language>
  <target-language>es</target-language>
  <string name="Here’s another new sentence." 
          context="this is some context" 
          id="5e3325d441c51b0f14d4bcbb">
  </string>
  <string name="We can’t possibly run irrigation to this tree, so it will have to survive on its own." 
          id="5e05ff60b5f2a4f81803b695">No es posible que podamos regar este árbol, por lo que tendrá que sobrevivir por sí solo.
  </string>
  <string name="What we do | Localize — LZ Product Demo" 
          context="Translator: google" 
          labels="lzm-meta-og:title, lz-page-title">Lo que hacemos | Localize - LZ Product Demo
  </string>
</resources>

Troubleshooting

If your import fails you can view the error here under Import History.