Files

Import translations

Changed on
post/files-api/v2/projects/{projectId}/locales/{localeId}/file/import

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.

fileType'android' | 'arb' | 'csv' | 'gettext' | 'ios' | 'javaProperties' | 'json' | 'pres' | 'qt' | 'resx' | 'srt' | 'stringsdict' | 'vtt' | 'xliff' | 'xliff2' | 'xml' | 'yaml' required

A unique identifier for the file type. Translations are matched to the source strings by string key. For JSON and XML files, which have no implicit keys, upload the source file with source_key_paths (or inline key paths for JSON) so that keys exist. Strings without a matching key are skipped and listed in translationImportErrors.

translationState'PUBLISHED' | 'POST_TRANSLATION' | 'POST_TRANSLATION_PREPUBLISH'

Value indicating the workflow state to import the translations into. Content will be imported into the language's default workflow. If omitted, PUBLISHED is used.

ValueDescription
PUBLISHEDThe translated content is published.
POST_TRANSLATIONThe translated content is imported into the first step after translation - if there is none, it will be published.
POST_TRANSLATION_PREPUBLISHSame as POST_TRANSLATION, but the import also forces the prepublish action.
overwriteboolean

Whether or not to overwrite existing translations.

Example request

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

Response

OK

Example response

{
  "response": {
    "data": {
      "translationImportErrors": [
        {
          "fileUri": "/content/en/home.json",
          "stringHashcode": "d41d8cd98f00b204e9800998ecf8427e"
        }
      ]
    }
  }
}

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

    • breaking

      the ///// response's property type changed from string to no type for status

    • info

      the request property became optional

    • info

      the request property default value PUBLISHED was added

    • info

      added the new POST_TRANSLATION_PREPUBLISH enum value to the request property

    • info

      added the new android enum value to the request property

    • info

      added the new arb enum value to the request property

    • info

      added the new csv enum value to the request property

    • info

      added the new gettext enum value to the request property

    • info

      added the new ios enum value to the request property

    • info

      added the new javaProperties enum value to the request property

    • info

      added the new json enum value to the request property

    • info

      added the new pres enum value to the request property

    • info

      added the new qt enum value to the request property

    • info

      added the new resx enum value to the request property

    • info

      added the new srt enum value to the request property

    • info

      added the new stringsdict enum value to the request property

    • info

      added the new vtt enum value to the request property

    • info

      added the new xliff enum value to the request property

    • info

      added the new xliff2 enum value to the request property

    • info

      added the new xml enum value to the request property

    • info

      added the new yaml enum value to the request property

    • info

      the request property type was generalized from string to no type

    • info

      added to the ///// response property allOf list for the response status

    • breaking

      removed the enum value android of the request property

    • breaking

      removed the enum value csv of the request property

    • breaking

      removed the enum value gettext of the request property

    • breaking

      removed the enum value ios of the request property

    • breaking

      removed the enum value java_properties of the request property

    • breaking

      removed the enum value json of the request property

    • breaking

      removed the enum value pres of the request property

    • breaking

      removed the enum value qt of the request property

    • breaking

      removed the enum value resx of the request property

    • breaking

      removed the enum value srt of the request property

    • breaking

      removed the enum value stringsdict of the request property

    • breaking

      removed the enum value xml of the request property

    • breaking

      removed the enum value yaml of the request property

    • info

      the request property default value false was added