RESX Import / Export for Web

Using the RESX file format to import/export content

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

You can also import/export Glossary terms.

Importing / Exporting

To see a general explanation of how importing and exporting works in Localize, click here. Be sure to adhere to the file requirements below so that Localize will be able to successfully read your files.

File Requirements

🚧

UTF-8 Character Encoding

Be sure that you are using the UTF-8 character encoding when working with the external files you are creating for importing purposes, so that special characters like accents are encoded properly.

The following are the requirements for the RESX file format.

The following header data is required for the file:

  • <?xml version="1.0" encoding="utf-8"?>
  • <root> - the root node
  • <languages> - the languages node specifies the source-language and target-language

The following header data is optional for the file:

  • <schema> - the schema node is optional as seen in the example below

The following data is optional for each <phrase-data> node:

  • <phrase> - string: the source language phrase
  • <translation> - string: the translation of the source language phrase
  • <description> - string: provides context for your translators
  • <phraseId> - string: this internal ID will be seen in any files exported from Localize
  • <labels> - 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.
<?xml version="1.0" encoding="utf-8"?>
<root>
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:element name="phrase-data">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="phrase" type="xsd:string" minOccurs="0" msdata:Ordinal="0" />
          <xsd:element name="translation" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
          <xsd:element name="description" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
          <xsd:element name="phraseId" type="xsd:string" minOccurs="0" msdata:Ordinal="3" />
          <xsd:element name="labels" type="xsd:string" minOccurs="0" msdata:Ordinal="4" />
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
    <xsd:element name="languages">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:attribute name="source-language" type="xsd:string" />
          <xsd:attribute name="target-language" type="xsd:string" />
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <languages source-language="en" target-language="es"/>
  <phrase-data>
    <phrase><![CDATA[Here is a new phrase to import via the RESX file format. This phrase doesn't have any translation yet.]]></phrase>
  </phrase-data>
  <phrase-data>
    <phrase><![CDATA[Another new phrase, but this one has a translation and some labels.]]></phrase>
    <translation><![CDATA[Otra frase nueva, pero esta tiene una traducción y algunas etiquetas.]]></translation>
    <labels>resx-import</labels>
  </phrase-data>
  <phrase-data>
    <phrase><![CDATA[A phrase with some context, but no translation.]]></phrase>
    <description>This is the context for this phrase.</description>
  </phrase-data>
</root>

Troubleshooting

If your import fails you will see a message on screen after the failure occurs. Or you can view the error here under Import History.


Did this page help you?