Download Translated Files - Multiple Locales as .ZIP

GET - /files-api/v2/projects/{projectId}/files/zip

Downloads the requested translated files from Smartling as a ZIP.

It is important to check the HTTP response status code. If Smartling finds and returns the file normally, you will receive a 200 SUCCESS response. If you receive any other response status code than 200, the requested files will not be part of the response.

When you upload a UTF-16 character encoded file, then /file/get requests for that file will have a character encoding of UTF-16. All other uploaded files will return with a character encoding of UTF-8.

You can always use the content-type header in the response of a file/get request to determine the character encoding.

Parameters

fileUris (required)

array - Smartling Values that each uniquely identify a file.

localeIds (required)

array - List of locales to download.

retrievalType (optional)

Determines the desired format for the download. Applies to translated files only.

pending Smartling returns any translations (including non-published translations).
published Smartling returns only published/pre-published translations.
pseudo Smartling returns a modified version of the original text with certain characters transformed and the text expanded. For example, the uploaded string "This is a sample string", will return as "T~hís ~ís á s~ámpl~é str~íñg". Pseudo translations enable you to test how a longer string integrates into your application.
contextMatchingInstrumented Smartling returns a modified version of the original file with strings wrapped in a specific set of Unicode symbols that can later be recognized and matched by the Chrome Context Capture Extension.

fileNameMode (optional)

Determines how files in the zip file will be named. If not set, the full original file path will be used as the filename.

UNCHANGED Full original file path is used.
TRIM_LEADING Remove all except the last path segment. e.g. /en/strings/nav.properties becomes nav.properties.
LOCALE_LAST Adds a locale folder to the file path directly before the filename. e.g. /strings/nav.properties becomes /strings/en/nav.properties.

localeMode (optional)

Determines how locales will be handled in the downloaded zip.

LOCALE_IN_PATH Locale code is added to the end of the file path. e.g. /strings/es-ES/nav.properties.
LOCALE_IN_NAME Locale code is added to the end of the file name e.g. /strings/nav_es-ES.properties.
LOCALE_IN_NAME_AND_PATH Locale code is added to both the path and the filename. e.g. /strings/es-ES/nav_es-ES.properties.

zipFileName (optional)

Name for the downloaded zip file. If unset, default is translations.zip.

includeOriginalStrings (optional)

Specifies whether Smartling will return the original string or an empty string where no translation is availabe. This parameter is supported for gettext, java properties, custom XML, and JSON files only.

true If there is no translation, Smartling returns the original string.
false If there is no translation, Smartling returns an empty string.
Returns

200 OK
HEADER:
Content-Disposition: attachment; filename="fname.ext"
file contents

The filename is based on the fileUri associated with the requested file. In most cases, the filename is exactly the fileUri provided. The only exception to this is with .pot gettext files. When a .pot file is specified as the fileUri, Smartling returns a .po file.

Examples