Files

Export translations

Changed on

Temporarily uploads a file, then returns a translated version for requested locales.

This call can be used instead of a standard upload/download if you keep different versions of a file in multiple branches or are triggering rebuilds, and don’t want your files in Smartling to be overwritten by out-of-date versions of a file.

To use the call, you upload a file and identify the Smartling URI where the main version of that file is saved. Smartling will match strings shared between the uploaded file and the main file and return any available translations.

post/files-api/v2/projects/{projectId}/locales/{localeId}/file/get-translations

Request

  • Base URL
    https://api.smartling.com
  • Auth
    HTTP bearer

Path parameters

projectIdstring required

Unique identifier of a Smartling project — 9 lowercase alphanumeric characters.

Example:84c012a33

A unique project identifier. This can be found in the Smartling Dashboard under Account Settings > API.

localeIdstring required

Locale identifier. Either a 2-letter language code (en) or a language-region pair (en-US). The language part is always lowercase; the region part is always uppercase.

Example:fr-FR

Identifier for a locale.

Request body multipart/form-data

filestring binary required

The file contents to upload.

fileUristring required

URI path of a source file within a Smartling project.

retrievalType'pending' | 'published' | 'pseudo' | 'contextMatchingInstrumented'

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

retrievalTypeDescription
pendingSmartling returns any translations (including non-published translations).
publishedSmartling returns only published/pre-published translations.
pseudoSmartling 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 "Thís ís á sámplé str~íñg". Pseudo translations enable you to test how a longer string integrates into your application.
contextMatchingInstrumentedSmartling 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.
includeOriginalStringsboolean

Specifies whether Smartling will return the original string or an empty string where no translation is available. This parameter is only supported for ANDROID, ARB, GETTEXT, IDML, IOS, JAVA Properties, JSON, QT, STRINGSDICT, XLIFF, XML, and YAML files. If unset, the default is <code>true</code>.

ValueDescription
trueIf there is no translation, Smartling returns the original string.
falseIf there is no translation, Smartling returns an empty string.

Example request

{
  "fileUri": "/content/en/home.json"
}

Response

OK

Changes

    • breaking

      added the pattern ^[a-z0-9]{9}$ to the path request parameter projectId

    • breaking

      added the pattern ^[a-z]{2}(-[A-Z]{2})?$ to the path request parameter localeId

    • breaking

      added to the request property allOf list

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • breaking

      the response property /// became nullable for the status

    • info

      the request property type was generalized from string to no type

    • breaking

      added the new required request property