CSV Import / Export for Mobile

Using the CSV 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.

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.

📘

Importing Source Phrases

If you are importing only source language phrases without translations, you should NOT have a language code specified in the target-language column. You still need to have target-language in the header row, but nothing in the rows beneath it.

Otherwise, you will get an error saying that the language code is incorrect.

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.

A Comma-Separated Values (CSV) file is a delimited text file that uses a comma to separate values.

  • General Requirements:

    • All CSV files must be comma delimited (semicolon is not supported)
    • Strings with spaces must have double quotes around them.
  • Header Row:

    • The file must include a header row at the top of the file which contains names corresponding to the fields in the file as follows:
    • phrase,translation,description,phraseId,labels,url,source-language,target-language,phraseKey
    • all field names above are REQUIRED, even if there is no data for some of the fields
    • the field names must be in the order specified
  • Field Descriptions:

    • phrase (required): the source phrase
    • translation (optional): the translation
    • description (optional): used to add context to the phrase for your translators
    • phraseId (optional): the internal phrase ID (used by the Localize back end)
    • labels (optional): an array of labels to add 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.
      • Multiple labels on a single phrase should be separated by spaces in the import file.
    • url (optional): a comma-delimited list of URLs where the phrase is found
    • source-language (required): the language code for the source language
    • target-language (optional): the language code for the target language
    • phraseKey (required): the unique phrase key for the phrase
phrase,translation,description,phraseId,labels,url,source-language,target-language,phraseKey
"This is the source phrase","Esta es la frase fuente",,,,,en,es,my-phrase-key
"another phrase","otra frase","some context",56bb755f9cf47fbd0ebb8677,mylabel,example.com/testing,en,es,another-key

View of the CSV file in table format:

📘

phraseKeys Required in Mobile Apps

phraseKeys are required for all phrases in Mobile App projects. If there isn't a phraseKey in a file imported into a Mobile project, that phrase will be ignored and won't be added to your Localize dashboard.

Troubleshooting

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

  • If you see the following error , you may be missing a comma in one of your lines, or have an extra one:
    • "Invalid closing quote at line 1; found "\"" instead of delimiter ","
  • If you see the following error, you may not have all of the proper columns and/or header field names:
    • Incorrect source language at row with phrase "phrase".