Skip to content

Commit 9266c68

Browse files
authored
feat(API): add use_locale_fallback option to download #SCD-620 (#976)
1 parent ebe1c68 commit 9266c68

File tree

4 files changed

+46
-9
lines changed

4 files changed

+46
-9
lines changed

clients/java/src/test/java/com/phrase/client/api/LocalesApiTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ public void localeDownloadTest() throws ApiException, IOException, InterruptedEx
167167
Boolean includeUnverifiedTranslations = null;
168168
Boolean useLastReviewedVersion = null;
169169
String fallbackLocaleId = null;
170+
Boolean useLocaleFallback = null;
170171
String sourceLocaleId = null;
171172
Object customMetadataFilters = null;
172173
String translationKeyPrefix = null;
@@ -177,7 +178,7 @@ public void localeDownloadTest() throws ApiException, IOException, InterruptedEx
177178
branch, fileFormat, tags, tag, includeEmptyTranslations, excludeEmptyZeroForms,
178179
includeTranslatedKeys, keepNotranslateTags, convertEmoji, formatOptions, encoding,
179180
skipUnverifiedTranslations, includeUnverifiedTranslations, useLastReviewedVersion,
180-
fallbackLocaleId, sourceLocaleId, translationKeyPrefix, filterByPrefix,
181+
fallbackLocaleId, useLocaleFallback, sourceLocaleId, translationKeyPrefix, filterByPrefix,
181182
customMetadataFilters, localeIds, updatedSince);
182183

183184
String fileContents = new String(java.nio.file.Files.readAllBytes(response.toPath()));

doc/compiled.json

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8833,13 +8833,22 @@
88338833
}
88348834
},
88358835
{
8836-
"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`.",
8837-
"example": null,
88388836
"name": "fallback_locale_id",
8837+
"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",
88398838
"in": "query",
88408839
"schema": {
88418840
"type": "string"
8842-
}
8841+
},
8842+
"example": null
8843+
},
8844+
{
8845+
"name": "use_locale_fallback",
8846+
"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",
8847+
"in": "query",
8848+
"schema": {
8849+
"type": "boolean"
8850+
},
8851+
"example": true
88438852
},
88448853
{
88458854
"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.",
@@ -9053,10 +9062,15 @@
90539062
]
90549063
},
90559064
"fallback_locale_id": {
9056-
"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`.",
9065+
"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",
90579066
"type": "string",
90589067
"example": "abcd1234abcd1234abcd1234abcd1234"
90599068
},
9069+
"use_locale_fallback": {
9070+
"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",
9071+
"type": "boolean",
9072+
"example": false
9073+
},
90609074
"source_locale_id": {
90619075
"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.",
90629076
"example": "abcd1234abcd1234abcd1234abcd1234",

paths/locale_downloads/create.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,19 @@ requestBody:
7373
- de
7474
- en
7575
fallback_locale_id:
76-
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`.
76+
description: |
77+
If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used.
78+
Provide the ID of the locale that should be used as the fallback.
79+
Requires `include_empty_translations` to be set to `true`. Mutually exclusive with `use_locale_fallback`.
7780
type: string
7881
example: abcd1234abcd1234abcd1234abcd1234
82+
use_locale_fallback:
83+
description: |
84+
If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used.
85+
Fallback locale is defined in [locale's settings](/en/api/strings/locales/update-a-locale#body-fallback-locale-id).
86+
Requires `include_empty_translations` to be set to `true`. Mutually exclusive with `fallback_locale_id`.
87+
type: boolean
88+
example: false
7989
source_locale_id:
8090
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.
8191
example: abcd1234abcd1234abcd1234abcd1234

paths/locales/download.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,24 @@ parameters:
100100
in: query
101101
schema:
102102
type: boolean
103-
- 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`.
104-
example:
105-
name: fallback_locale_id
103+
- name: fallback_locale_id
104+
description: |
105+
If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used.
106+
Provide the ID of the locale that should be used as the fallback.
107+
Requires `include_empty_translations` to be set to `true`. Mutually exclusive with `use_locale_fallback`.
106108
in: query
107109
schema:
108110
type: string
111+
example:
112+
- name: use_locale_fallback
113+
description: |
114+
If a key has no translation in the locale being downloaded, the translation in the fallback locale will be used.
115+
Fallback locale is defined in [locale's settings](/en/api/strings/locales/update-a-locale#body-fallback-locale-id).
116+
Requires `include_empty_translations` to be set to `true`. Mutually exclusive with `fallback_locale_id`.
117+
in: query
118+
schema:
119+
type: boolean
120+
example: true
109121
- 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.
110122
example:
111123
name: source_locale_id

0 commit comments

Comments
 (0)