Skip to main content

Single step import

POST 

/v2/projects/:projectId/single-step-import

Unlike the /v2/projects/{projectId}/import endpoint, imports the data in single request by provided files and parameters. This is useful for automated importing via API or CLI.

Request

Path Parameters

    projectId int64required

Body

    files binary[]required
    params objectrequired
    structureDelimiter string

    When importing files in structured formats (e.g., JSON, YAML), this field defines the delimiter which will be used in names of imported keys.

    forceMode stringrequired

    Possible values: [OVERRIDE, KEEP, NO_FORCE]

    Whether to override existing translation data.

    When set to KEEP, existing translations will be kept.

    When set to OVERRIDE, existing translations will be overwrote.

    When set to NO_FORCE, error will be thrown on conflict.

    languageMappings object[]

    Maps the languages from imported files to languages existing in the Tolgee platform.

    Use this field only when your files contain multiple languages (e.g., XLIFF files).

    Otherwise, use the languageTag property of fileMappings.

    Example: In xliff files, there are source-language and target-language attributes defined on file element. Using this field you can map source and target values to languages stored in the Tolgee Platform.

  • Array [
  • importLanguage stringrequired

    The language from the imported file.

    For xliff files, this is the source-language or the target-language attribute value of file element.

    platformLanguageTag stringrequired

    The tag of language existing in the Tolgee platform to which the imported language should be mapped.

  • ]
  • overrideKeyDescriptions booleanrequired

    If true, key descriptions will be overridden by the import

    convertPlaceholdersToIcu booleanrequired

    If true, placeholders from other formats will be converted to ICU when possible

    createNewKeys booleanrequired

    If false, only updates keys, skipping the creation of new keys

    fileMappings object[]required

    Definition of mapping for each file to import.

  • Array [
  • fileName stringrequired

    Name of the file to import. This is the name of the file provided in files request part or in uploaded archive.

    namespace string

    Namespace to import the file to. If not provided, the key will be imported without namespace.

    format string

    Possible values: [JSON_I18NEXT, JSON_ICU, JSON_JAVA, JSON_PHP, JSON_RUBY, JSON_C, PO_PHP, PO_C, PO_JAVA, PO_ICU, PO_RUBY, STRINGS, STRINGSDICT, APPLE_XLIFF, PROPERTIES_ICU, PROPERTIES_JAVA, PROPERTIES_UNKNOWN, ANDROID_XML, FLUTTER_ARB, YAML_RUBY, YAML_JAVA, YAML_ICU, YAML_PHP, YAML_UNKNOWN, XLIFF_ICU, XLIFF_JAVA, XLIFF_PHP, XLIFF_RUBY]

    Format of the file. If not provided, Tolgee will try to guess the format from the file name or file contents.

    It is recommended to provide these values to prevent any issues with format detection.

    languageTag string

    The existing language tag in the Tolgee platform to which the imported language should be mapped.

    When null, Tolgee will try to guess the language from the file contents or file name.

  • ]
  • tagNewKeys string[]required

    Keys created by this import will be tagged with these tags. It add tags only to new keys. The keys that already exist will not be tagged.

    removeOtherKeys boolean

    If yes, keys from project that were not included in import will be deleted.

Responses

OK

Loading...