From 11003ace7353bf99893482ca4aa32214abf3e581 Mon Sep 17 00:00:00 2001 From: Ildar Safin Date: Mon, 26 Aug 2024 11:45:26 +0200 Subject: [PATCH] feat: Add update_translations_on_source_match (#670) * Add update_translations_on_source_match upload option to cli --- .../src/test/java/com/phrase/client/api/UploadsApiTest.java | 3 ++- doc/compiled.json | 6 ++++++ paths/uploads/create.yaml | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/clients/java/src/test/java/com/phrase/client/api/UploadsApiTest.java b/clients/java/src/test/java/com/phrase/client/api/UploadsApiTest.java index 95f3da5d..7b3e6832 100644 --- a/clients/java/src/test/java/com/phrase/client/api/UploadsApiTest.java +++ b/clients/java/src/test/java/com/phrase/client/api/UploadsApiTest.java @@ -97,6 +97,7 @@ public void uploadCreateTest() throws ApiException, IOException, InterruptedExce String tags = null; Boolean updateTranslations = null; Boolean updateTranslationKeys = true; + Boolean updateTranslationsOnSourceMatch = null; Boolean updateDescriptions = null; Boolean convertEmoji = null; Boolean skipUploadTags = null; @@ -107,7 +108,7 @@ public void uploadCreateTest() throws ApiException, IOException, InterruptedExce Boolean autotranslate = null; Boolean markReviewed = null; Boolean tagOnlyAffectedKeys = null; - Upload response = api.uploadCreate(projectId, file, fileFormat, localeId, xPhraseAppOTP, branch, tags, updateTranslations, updateTranslationKeys, updateDescriptions, convertEmoji, skipUploadTags, skipUnverification, fileEncoding, localeMapping, formatOptions, autotranslate, markReviewed, tagOnlyAffectedKeys); + Upload response = api.uploadCreate(projectId, file, fileFormat, localeId, xPhraseAppOTP, branch, tags, updateTranslations, updateTranslationKeys, updateTranslationsOnSourceMatch, updateDescriptions, convertEmoji, skipUploadTags, skipUnverification, fileEncoding, localeMapping, formatOptions, autotranslate, markReviewed, tagOnlyAffectedKeys); Assert.assertEquals("valid id returned", "id_example", response.getId()); Assert.assertEquals("valid creation date returned", OffsetDateTime.parse("2015-01-28T09:52:53Z"), response.getCreatedAt()); diff --git a/doc/compiled.json b/doc/compiled.json index 990cd6ae..9c739ab6 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -14989,6 +14989,12 @@ "default": true, "example": null }, + "update_translations_on_source_match": { + "description": "Update target translations only if the source translations of the uploaded multilingual file match the stored translations.", + "type": "boolean", + "default": false, + "example": null + }, "update_descriptions": { "description": "Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions.", "type": "boolean", diff --git a/paths/uploads/create.yaml b/paths/uploads/create.yaml index a5739993..53115249 100644 --- a/paths/uploads/create.yaml +++ b/paths/uploads/create.yaml @@ -94,6 +94,11 @@ requestBody: type: boolean default: true example: + update_translations_on_source_match: + description: Update target translations only if the source translations of the uploaded multilingual file match the stored translations. + type: boolean + default: false + example: update_descriptions: description: Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions. type: boolean