Skip to content

Commit c36f33b

Browse files
authored
Merge pull request #457 from DeepL/docs/style-rules-language-variants
docs: add style rules language variants to the OpenAPI spec and chang…
2 parents acdd695 + d4b1b82 commit c36f33b

3 files changed

Lines changed: 105 additions & 9 deletions

File tree

‎api-reference/openapi.json‎

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@
820820
}
821821
},
822822
"style_id": {
823-
"description": "Specify the [style rule list](/docs/customize/using-style-rules) to use for the translation.\n\n**Important:** The target language has to match the language of the style rule list.\n\nAll `model_type` values are supported.",
823+
"description": "Specify the [style rule list](/docs/customize/using-style-rules) to use for the translation.\n\n**Important:** The target language has to match the language of the style rule list. A list\ncreated for a root language (for example `en`) applies to that language and all of its variants\n(`EN-GB`, `EN-US`). A list created for a variant (for example `en-GB`) applies only when\n`target_lang` is that variant.\n\nAll `model_type` values are supported.",
824824
"type": "string",
825825
"example": "7ff9bfd6-cd85-4190-8503-d6215a321519"
826826
},
@@ -1200,7 +1200,7 @@
12001200
}
12011201
},
12021202
"style_id": {
1203-
"description": "Specify the [style rule list](/docs/customize/using-style-rules) to use for the translation.\n\n**Important:** The target language has to match the language of the style rule list.",
1203+
"description": "Specify the [style rule list](/docs/customize/using-style-rules) to use for the translation.\n\n**Important:** The target language has to match the language of the style rule list. A list\ncreated for a root language (for example `en`) applies to that language and all of its variants\n(`EN-GB`, `EN-US`). A list created for a variant (for example `en-GB`) applies only when\n`target_lang` is that variant.",
12041204
"type": "string",
12051205
"example": "7ff9bfd6-cd85-4190-8503-d6215a321519"
12061206
},
@@ -5285,7 +5285,7 @@
52855285
"post": {
52865286
"summary": "Create a style rule list",
52875287
"operationId": "createStyleRuleList",
5288-
"description": "Create a style rule list for a single language, optionally with its configured rules\nand custom instructions. Use the returned `style_id` with the translation endpoints\nto apply the list.",
5288+
"description": "Create a style rule list for a single language, optionally with its configured rules\nand custom instructions. The `language` can be a root code such as `de` or a variant\ncode such as `de-CH`. Use the returned `style_id` with the translation endpoints\nto apply the list.",
52895289
"requestBody": {
52905290
"required": true,
52915291
"content": {
@@ -8842,17 +8842,54 @@
88428842
"example": "bd0a38f3-1831-440b-a8dd-2c702e2325ab"
88438843
},
88448844
"StyleRuleLanguage": {
8845-
"description": "The language that the style rule list is applied to.",
8845+
"description": "The target language the style rule list applies to. Codes are matched case-insensitively;\nthe response returns the canonical form (for example `de-CH`).\n\nA root code (for example `en`) applies to that language and all of its variants. A variant\ncode (for example `en-GB`) applies only when `target_lang` is that variant.\n\nVariant lists for `de-CH`, `fr-CA`, `pt-BR`, and `pt-PT` are generally available. Variant\nlists for `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-FR`, `zh-Hans`, and `zh-Hant`\nare in beta. The current list and the status of each language are returned by\n[`GET /v3/languages?resource=style_rules&include=beta`](/docs/languages/using-the-languages-api).",
88468846
"type": "string",
88478847
"enum": [
8848+
"ar",
8849+
"bg",
8850+
"cs",
8851+
"da",
88488852
"de",
8853+
"de-CH",
8854+
"de-DE",
8855+
"el",
88498856
"en",
8857+
"en-GB",
8858+
"en-US",
88508859
"es",
8860+
"es-419",
8861+
"es-ES",
8862+
"et",
8863+
"fi",
88518864
"fr",
8865+
"fr-CA",
8866+
"fr-FR",
8867+
"he",
8868+
"hu",
8869+
"id",
88528870
"it",
88538871
"ja",
88548872
"ko",
8855-
"zh"
8873+
"lt",
8874+
"lv",
8875+
"nb",
8876+
"nl",
8877+
"pl",
8878+
"pt",
8879+
"pt-BR",
8880+
"pt-PT",
8881+
"ro",
8882+
"ru",
8883+
"sk",
8884+
"sl",
8885+
"sv",
8886+
"th",
8887+
"tr",
8888+
"uk",
8889+
"vi",
8890+
"zh",
8891+
"zh-Hans",
8892+
"zh-Hant"
88568893
]
88578894
},
88588895
"StyleRuleName": {

‎api-reference/openapi.yaml‎

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,10 @@ paths:
647647
description: |-
648648
Specify the [style rule list](/docs/customize/using-style-rules) to use for the translation.
649649
650-
**Important:** The target language has to match the language of the style rule list.
650+
**Important:** The target language has to match the language of the style rule list. A list
651+
created for a root language (for example `en`) applies to that language and all of its variants
652+
(`EN-GB`, `EN-US`). A list created for a variant (for example `en-GB`) applies only when
653+
`target_lang` is that variant.
651654
652655
All `model_type` values are supported.
653656
type: string
@@ -979,7 +982,10 @@ paths:
979982
description: |-
980983
Specify the [style rule list](/docs/customize/using-style-rules) to use for the translation.
981984
982-
**Important:** The target language has to match the language of the style rule list.
985+
**Important:** The target language has to match the language of the style rule list. A list
986+
created for a root language (for example `en`) applies to that language and all of its variants
987+
(`EN-GB`, `EN-US`). A list created for a variant (for example `en-GB`) applies only when
988+
`target_lang` is that variant.
983989
type: string
984990
example: 7ff9bfd6-cd85-4190-8503-d6215a321519
985991
translation_memory_id:
@@ -3797,7 +3803,8 @@ paths:
37973803
operationId: createStyleRuleList
37983804
description: |-
37993805
Create a style rule list for a single language, optionally with its configured rules
3800-
and custom instructions. Use the returned `style_id` with the translation endpoints
3806+
and custom instructions. The `language` can be a root code such as `de` or a variant
3807+
code such as `de-CH`. Use the returned `style_id` with the translation endpoints
38013808
to apply the list.
38023809
requestBody:
38033810
required: true
@@ -6389,17 +6396,64 @@ components:
63896396
description: A unique ID assigned to a style rule list.
63906397
example: "bd0a38f3-1831-440b-a8dd-2c702e2325ab"
63916398
StyleRuleLanguage:
6392-
description: The language that the style rule list is applied to.
6399+
description: |-
6400+
The target language the style rule list applies to. Codes are matched case-insensitively;
6401+
the response returns the canonical form (for example `de-CH`).
6402+
6403+
A root code (for example `en`) applies to that language and all of its variants. A variant
6404+
code (for example `en-GB`) applies only when `target_lang` is that variant.
6405+
6406+
Variant lists for `de-CH`, `fr-CA`, `pt-BR`, and `pt-PT` are generally available. Variant
6407+
lists for `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-FR`, `zh-Hans`, and `zh-Hant`
6408+
are in beta. The current list and the status of each language are returned by
6409+
[`GET /v3/languages?resource=style_rules&include=beta`](/docs/languages/using-the-languages-api).
63936410
type: string
63946411
enum:
6412+
- ar
6413+
- bg
6414+
- cs
6415+
- da
63956416
- de
6417+
- de-CH
6418+
- de-DE
6419+
- el
63966420
- en
6421+
- en-GB
6422+
- en-US
63976423
- es
6424+
- es-419
6425+
- es-ES
6426+
- et
6427+
- fi
63986428
- fr
6429+
- fr-CA
6430+
- fr-FR
6431+
- he
6432+
- hu
6433+
- id
63996434
- it
64006435
- ja
64016436
- ko
6437+
- lt
6438+
- lv
6439+
- nb
6440+
- nl
6441+
- pl
6442+
- pt
6443+
- pt-BR
6444+
- pt-PT
6445+
- ro
6446+
- ru
6447+
- sk
6448+
- sl
6449+
- sv
6450+
- th
6451+
- tr
6452+
- uk
6453+
- vi
64026454
- zh
6455+
- zh-Hans
6456+
- zh-Hant
64036457
StyleRuleName:
64046458
description: Name associated with the style rule list.
64056459
type: string

‎docs/resources/roadmap-and-release-notes.mdx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ rss: true
99
</Update>
1010

1111
<Update label="September 2026">
12+
## September 29 - Style Rules for Language Variants
13+
- [Style rule lists](/docs/customize/using-style-rules) hold the configured rules and custom instructions DeepL applies when translating into one target language. A list could previously only be created for a root language such as `de`, and it applied to every variant of that language. You can now also create a list for a specific variant, such as `de-CH` or `en-GB`, so conventions that differ between variants stay separate.
14+
- Set the variant code in the `language` field of [`POST /v3/style_rules`](/api-reference/style-rules/create-style-rule). A variant list applies when `target_lang` is that variant; root-language lists keep applying to all variants as before.
15+
- Lists for `de-CH`, `fr-CA`, `pt-BR`, and `pt-PT` are generally available; lists for `de-DE`, `en-GB`, `en-US`, `es-419`, `es-ES`, `fr-FR`, `zh-Hans`, and `zh-Hant` are in beta. The current list and the status of each language are returned by [`GET /v3/languages?resource=style_rules&include=beta`](/docs/languages/using-the-languages-api).
16+
1217
## September 22 - New Voice API Languages: Catalan and Galician
1318
- The [Voice API](/docs/voice/overview) now supports `ca` (Catalan) and `gl` (Galician) as source languages and as targets for translation and translated speech. Both are beta for the Voice API; they are already generally available for text and document translation. Translation is provided by DeepL; transcription and translated speech are provided by external service partners, so the source language must be set explicitly (no auto-detection).
1419
- Both languages are marked `"external": true` on the `transcription` and `translated_speech` features in the [`GET /v3/languages?resource=voice`](/docs/languages/using-the-languages-api) response. Because they are beta and external, call with `include=beta&include=external` to see them.

0 commit comments

Comments
 (0)