From 5c1409ce0f0d38f9e07a6306b253e9eaa6a81825 Mon Sep 17 00:00:00 2001 From: Mladen Jablanovic Date: Fri, 28 Nov 2025 16:47:13 +0100 Subject: [PATCH 1/3] feat(API): add use_local_fallback option to download #SCD-620 --- doc/compiled.json | 15 ++++++++++++++- paths/locale_downloads/create.yaml | 12 +++++++++++- paths/locales/download.yaml | 8 ++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/doc/compiled.json b/doc/compiled.json index f30b9b880..6c560c597 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -8841,6 +8841,14 @@ "type": "string" } }, + { + "description": "If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used.\nFallback locale is defined in [locale's settings](/en/api/strings/locales/update-a-locale#body-fallback-locale-id).\nRequires `include_empty_translations` to be set to `true`.\n", + "name": "use_locale_fallback", + "in": "query", + "schema": { + "type": "boolean" + } + }, { "description": "Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a `tag` parameter indicating a specific job.", "example": null, @@ -9053,10 +9061,15 @@ ] }, "fallback_locale_id": { - "description": "If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to `true`.", + "description": "If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used.\nProvide the ID of the locale that should be used as the fallback.\nRequires `include_empty_translations` to be set to `true`.\n", "type": "string", "example": "abcd1234abcd1234abcd1234abcd1234" }, + "use_locale_fallback": { + "description": "If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used.\nFallback locale is defined in [locale's settings](/en/api/strings/locales/update-a-locale#body-fallback-locale-id).\nRequires `include_empty_translations` to be set to `true`.\n", + "type": "boolean", + "example": false + }, "source_locale_id": { "description": "Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a `tag` parameter indicating a specific job.", "example": "abcd1234abcd1234abcd1234abcd1234", diff --git a/paths/locale_downloads/create.yaml b/paths/locale_downloads/create.yaml index 52e9a9056..bb541f904 100644 --- a/paths/locale_downloads/create.yaml +++ b/paths/locale_downloads/create.yaml @@ -73,9 +73,19 @@ requestBody: - de - en fallback_locale_id: - description: If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to `true`. + description: | + If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used. + Provide the ID of the locale that should be used as the fallback. + Requires `include_empty_translations` to be set to `true`. type: string example: abcd1234abcd1234abcd1234abcd1234 + use_locale_fallback: + description: | + If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used. + Fallback locale is defined in [locale's settings](/en/api/strings/locales/update-a-locale#body-fallback-locale-id). + Requires `include_empty_translations` to be set to `true`. + type: boolean + example: false source_locale_id: description: Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a `tag` parameter indicating a specific job. example: abcd1234abcd1234abcd1234abcd1234 diff --git a/paths/locales/download.yaml b/paths/locales/download.yaml index 54c33dbb4..878167b21 100644 --- a/paths/locales/download.yaml +++ b/paths/locales/download.yaml @@ -106,6 +106,14 @@ parameters: in: query schema: type: string + - description: | + If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used. + Fallback locale is defined in [locale's settings](/en/api/strings/locales/update-a-locale#body-fallback-locale-id). + Requires `include_empty_translations` to be set to `true`. + name: use_locale_fallback + in: query + schema: + type: boolean - description: Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a `tag` parameter indicating a specific job. example: name: source_locale_id From f99446dbc551b25d5361b8a436c7b428318879fc Mon Sep 17 00:00:00 2001 From: Mladen Jablanovic Date: Fri, 28 Nov 2025 16:51:18 +0100 Subject: [PATCH 2/3] adapt java spec --- .../src/test/java/com/phrase/client/api/LocalesApiTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clients/java/src/test/java/com/phrase/client/api/LocalesApiTest.java b/clients/java/src/test/java/com/phrase/client/api/LocalesApiTest.java index 8507fe343..6a39b4c94 100644 --- a/clients/java/src/test/java/com/phrase/client/api/LocalesApiTest.java +++ b/clients/java/src/test/java/com/phrase/client/api/LocalesApiTest.java @@ -167,6 +167,7 @@ public void localeDownloadTest() throws ApiException, IOException, InterruptedEx Boolean includeUnverifiedTranslations = null; Boolean useLastReviewedVersion = null; String fallbackLocaleId = null; + Boolean useLocaleFallback = null; String sourceLocaleId = null; Object customMetadataFilters = null; String translationKeyPrefix = null; @@ -177,7 +178,7 @@ public void localeDownloadTest() throws ApiException, IOException, InterruptedEx branch, fileFormat, tags, tag, includeEmptyTranslations, excludeEmptyZeroForms, includeTranslatedKeys, keepNotranslateTags, convertEmoji, formatOptions, encoding, skipUnverifiedTranslations, includeUnverifiedTranslations, useLastReviewedVersion, - fallbackLocaleId, sourceLocaleId, translationKeyPrefix, filterByPrefix, + fallbackLocaleId, useLocaleFallback, sourceLocaleId, translationKeyPrefix, filterByPrefix, customMetadataFilters, localeIds, updatedSince); String fileContents = new String(java.nio.file.Files.readAllBytes(response.toPath())); From 5cfc6d2acf38ef91dee659ca3080cfe948d29070 Mon Sep 17 00:00:00 2001 From: Mladen Jablanovic Date: Mon, 1 Dec 2025 08:48:07 +0100 Subject: [PATCH 3/3] copilot suggestions --- doc/compiled.json | 15 ++++++++------- paths/locale_downloads/create.yaml | 4 ++-- paths/locales/download.yaml | 16 ++++++++++------ 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/doc/compiled.json b/doc/compiled.json index 6c560c597..7b3dc8091 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -8833,21 +8833,22 @@ } }, { - "description": "If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to `true`.", - "example": null, "name": "fallback_locale_id", + "description": "If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used.\nProvide the ID of the locale that should be used as the fallback.\nRequires `include_empty_translations` to be set to `true`. Mutually exclusive with `use_locale_fallback`.\n", "in": "query", "schema": { "type": "string" - } + }, + "example": null }, { - "description": "If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used.\nFallback locale is defined in [locale's settings](/en/api/strings/locales/update-a-locale#body-fallback-locale-id).\nRequires `include_empty_translations` to be set to `true`.\n", "name": "use_locale_fallback", + "description": "If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used.\nFallback locale is defined in [locale's settings](/en/api/strings/locales/update-a-locale#body-fallback-locale-id).\nRequires `include_empty_translations` to be set to `true`. Mutually exclusive with `fallback_locale_id`.\n", "in": "query", "schema": { "type": "boolean" - } + }, + "example": true }, { "description": "Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a `tag` parameter indicating a specific job.", @@ -9061,12 +9062,12 @@ ] }, "fallback_locale_id": { - "description": "If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used.\nProvide the ID of the locale that should be used as the fallback.\nRequires `include_empty_translations` to be set to `true`.\n", + "description": "If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used.\nProvide the ID of the locale that should be used as the fallback.\nRequires `include_empty_translations` to be set to `true`. Mutually exclusive with `use_locale_fallback`.\n", "type": "string", "example": "abcd1234abcd1234abcd1234abcd1234" }, "use_locale_fallback": { - "description": "If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used.\nFallback locale is defined in [locale's settings](/en/api/strings/locales/update-a-locale#body-fallback-locale-id).\nRequires `include_empty_translations` to be set to `true`.\n", + "description": "If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used.\nFallback locale is defined in [locale's settings](/en/api/strings/locales/update-a-locale#body-fallback-locale-id).\nRequires `include_empty_translations` to be set to `true`. Mutually exclusive with `fallback_locale_id`.\n", "type": "boolean", "example": false }, diff --git a/paths/locale_downloads/create.yaml b/paths/locale_downloads/create.yaml index bb541f904..a21ce790e 100644 --- a/paths/locale_downloads/create.yaml +++ b/paths/locale_downloads/create.yaml @@ -76,14 +76,14 @@ requestBody: description: | If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used. Provide the ID of the locale that should be used as the fallback. - Requires `include_empty_translations` to be set to `true`. + Requires `include_empty_translations` to be set to `true`. Mutually exclusive with `use_locale_fallback`. type: string example: abcd1234abcd1234abcd1234abcd1234 use_locale_fallback: description: | If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used. Fallback locale is defined in [locale's settings](/en/api/strings/locales/update-a-locale#body-fallback-locale-id). - Requires `include_empty_translations` to be set to `true`. + Requires `include_empty_translations` to be set to `true`. Mutually exclusive with `fallback_locale_id`. type: boolean example: false source_locale_id: diff --git a/paths/locales/download.yaml b/paths/locales/download.yaml index 878167b21..dc7188d88 100644 --- a/paths/locales/download.yaml +++ b/paths/locales/download.yaml @@ -100,20 +100,24 @@ parameters: in: query schema: type: boolean - - description: If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to `true`. - example: - name: fallback_locale_id + - name: fallback_locale_id + description: | + If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used. + Provide the ID of the locale that should be used as the fallback. + Requires `include_empty_translations` to be set to `true`. Mutually exclusive with `use_locale_fallback`. in: query schema: type: string - - description: | + example: + - name: use_locale_fallback + description: | If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used. Fallback locale is defined in [locale's settings](/en/api/strings/locales/update-a-locale#body-fallback-locale-id). - Requires `include_empty_translations` to be set to `true`. - name: use_locale_fallback + Requires `include_empty_translations` to be set to `true`. Mutually exclusive with `fallback_locale_id`. in: query schema: type: boolean + example: true - description: Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a `tag` parameter indicating a specific job. example: name: source_locale_id