Skip to content

Commit

Permalink
feat: add Ukrainian source and target languages.
Browse files Browse the repository at this point in the history
Also includes other fixes and add request body size limit
  • Loading branch information
daniel-jones-dev committed Oct 5, 2022
1 parent 708a8aa commit d222b54
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 55 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ number is used only for corrections to the OpenAPI specification, for example:
typos, schema fixes, or adding examples.


## [2.3.0]
### Added
* Add Ukrainian source and target languages.
### Changed
* Add request body size limit to translateText description.
### Fixed
* Add "Simplified" label to ZH (Chinese) target language.
* Fix a typo in an example.
* Markdown fixes.


## [2.2.0]
### Added
* Add support for EN (English) ←→ PL (Polish) glossaries.
Expand All @@ -32,6 +43,7 @@ typos, schema fixes, or adding examples.
Initial release of the OpenAPI specification.


[2.3.0]: https://github.com/DeepLcom/openapi/compare/v2.2.0...v2.3.0
[2.2.0]: https://github.com/DeepLcom/openapi/compare/v2.1.0...v2.2.0
[2.1.0]: https://github.com/DeepLcom/openapi/compare/v2.0.0...v2.1.0
[2.0.0]: https://github.com/DeepLcom/openapi/releases/tag/v2.0.0
27 changes: 17 additions & 10 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "DeepL - Contact us",
"url": "https://www.deepl.com/contact-us"
},
"version": "2.2.0"
"version": "2.3.0"
},
"externalDocs": {
"description": "DeepL Pro - Plans and pricing",
Expand Down Expand Up @@ -50,7 +50,7 @@
],
"summary": "Request Translation",
"operationId": "translateText",
"description": "The translate function.",
"description": "The translate function.\n\n\nThe total request body size must not exceed 128 KiB (128 \u00b7 1024 bytes). Please split up your text into multiple\ncalls if it exceeds this limit.",
"requestBody": {
"required": true,
"content": {
Expand All @@ -60,7 +60,7 @@
"summary": "Basic Example",
"value": {
"text": [
"Hello, world"
"Hello, world!"
],
"target_lang": "DE"
}
Expand All @@ -69,7 +69,7 @@
"summary": "Using a Glossary",
"value": {
"text": [
"Hello, world"
"Hello, world!"
],
"target_lang": "DE",
"source_lang": "EN",
Expand Down Expand Up @@ -119,7 +119,7 @@
"$ref": "#/components/schemas/TargetLanguage"
},
"split_sentences": {
"description": "Sets whether the translation engine should first split the input into sentences. This is enabled by default. Possible values are:\n * `0` - no splitting at all, whole input is treated as one sentence\n * `1` (default) - splits on punctuation and on newlines\n * `nonewlines` - splits on punctuation only, ignoring newlines\n\nFor applications that send one sentence per text parameter, it is advisable to set `split_sentences` to `0`, in order to prevent the engine from splitting the sentence unintentionally.\n\n\nPlease note that newlines will split sentences. You should therefore clean files to avoid breaking sentences or set the parameter `split_sentences` to `nonewlines`. In the example below, the two parts of the sentence have been translated separately and this has caused an error: The word \"the\" has been incorrectly translated as \"die\" (the feminine definite article in German), though the German word for \"sentence\", \"Satz\", is masculine (der Satz).\n * Example request:\n```\n<div>This is the first\nsentence.</div>\n```\n * Example response:\n```\n<div>Dies ist die erste\nSatz.</div>\n```",
"description": "Sets whether the translation engine should first split the input into sentences. This is enabled by default. Possible values are:\n * `0` - no splitting at all, whole input is treated as one sentence\n * `1` (default) - splits on punctuation and on newlines\n * `nonewlines` - splits on punctuation only, ignoring newlines\n\nFor applications that send one sentence per text parameter, it is advisable to set `split_sentences` to `0`, in order to prevent the engine from splitting the sentence unintentionally.\n\n\nPlease note that newlines will split sentences. You should therefore clean files to avoid breaking sentences or set the parameter `split_sentences` to `nonewlines`. In the example below, the two parts of the sentence have been translated separately and this has caused an error: The word \"the\" has been incorrectly translated as \"die\" (the feminine definite article in German), though the German word for \"sentence\", \"Satz\", is masculine (der Satz).\n * Example request:\n ```\n <div>This is the first\n sentence.</div>\n ```\n * Example response:\n ```\n <div>Dies ist der erste\n Satz.</div>\n ```",
"type": "string",
"enum": [
"0",
Expand Down Expand Up @@ -157,7 +157,7 @@
"type": "string"
},
"outline_detection": {
"description": "The automatic detection of the XML structure won't yield best results in all XML files. You can disable this automatic mechanism altogether by setting the `outline_detection` parameter to `0` and selecting the tags that should be considered structure tags. This will split sentences using the `splitting_tags` parameter.\n\n\nIn the example below, we achieve the same results as the automatic engine by disabling automatic detection with `outline_detection=0` and setting the parameters manually to `tag_handling=xml`, `split_sentences=nonewlines`, and `splitting_tags=par,title`.\n * Example request:\n\n\n <document>\n <meta>\n <title>A document's title</title>\n </meta>\n <content>\n <par>This is the first sentence. Followed by a second one.</par>\n <par>This is the third sentence.</par>\n </content>\n </document>\n\n * Example response:\n\n\n <document>\n <meta>\n <title>Der Titel eines Dokuments</title>\n </meta>\n <content>\n <par>Das ist der erste Satz. Gefolgt von einem zweiten.</par>\n <par>Dies ist der dritte Satz.</par>\n </content>\n </document>\n\n\nWhile this approach is slightly more complicated, it allows for greater control over the structure of the translation output.",
"description": "The automatic detection of the XML structure won't yield best results in all XML files. You can disable this automatic mechanism altogether by setting the `outline_detection` parameter to `0` and selecting the tags that should be considered structure tags. This will split sentences using the `splitting_tags` parameter.\n\n\nIn the example below, we achieve the same results as the automatic engine by disabling automatic detection with `outline_detection=0` and setting the parameters manually to `tag_handling=xml`, `split_sentences=nonewlines`, and `splitting_tags=par,title`.\n * Example request:\n ```\n <document>\n <meta>\n <title>A document's title</title>\n </meta>\n <content>\n <par>This is the first sentence. Followed by a second one.</par>\n <par>This is the third sentence.</par>\n </content>\n </document>\n ```\n * Example response:\n ```\n <document>\n <meta>\n <title>Der Titel eines Dokuments</title>\n </meta>\n <content>\n <par>Das ist der erste Satz. Gefolgt von einem zweiten.</par>\n <par>Dies ist der dritte Satz.</par>\n </content>\n </document>\n ```\nWhile this approach is slightly more complicated, it allows for greater control over the structure of the translation output.",
"type": "string",
"enum": [
"0"
Expand All @@ -168,7 +168,7 @@
"type": "string"
},
"ignore_tags": {
"description": "Comma-separated list of XML tags that indicate text not to be translated.\n\n\nUse this paramter to ensure that elements in the original text are not altered in the translation (e.g., trademarks, product names) and insert tags into your original text. In the following example, the `ignore_tags` parameter is set to `keep`:\n * Example request:\n```\nPlease open the page <keep>Settings</keep> to configure your system.\n```\n * Example response:\n```\nBitte \u00f6ffnen Sie die Seite <keep>Settings</keep> um Ihr System zu konfigurieren.\n```",
"description": "Comma-separated list of XML tags that indicate text not to be translated.\n\n\nUse this paramter to ensure that elements in the original text are not altered in the translation (e.g., trademarks, product names) and insert tags into your original text. In the following example, the `ignore_tags` parameter is set to `keep`:\n * Example request:\n ```\n Please open the page <keep>Settings</keep> to configure your system.\n ```\n * Example response:\n ```\n Bitte \u00f6ffnen Sie die Seite <keep>Settings</keep> um Ihr System zu konfigurieren.\n ```",
"type": "string"
}
}
Expand Down Expand Up @@ -1375,9 +1375,14 @@
"name": "Turkish",
"supports_formality": false
},
{
"language": "UK",
"name": "Ukrainian",
"supports_formality": false
},
{
"language": "ZH",
"name": "Chinese",
"name": "Chinese (simplified)",
"supports_formality": false
}
]
Expand Down Expand Up @@ -1680,7 +1685,7 @@
},
"SourceLanguage": {
"type": "string",
"description": "Language of the text to be translated. Options currently available:\n * `BG` - Bulgarian\n * `CS` - Czech\n * `DA` - Danish\n * `DE` - German\n * `EL` - Greek\n * `EN` - English\n * `ES` - Spanish\n * `ET` - Estonian\n * `FI` - Finnish\n * `FR` - French\n * `HU` - Hungarian\n * `ID` - Indonesian\n * `IT` - Italian\n * `JA` - Japanese\n * `LT` - Lithuanian\n * `LV` - Latvian\n * `NL` - Dutch\n * `PL` - Polish\n * `PT` - Portuguese (all Portuguese varieties mixed)\n * `RO` - Romanian\n * `RU` - Russian\n * `SK` - Slovak\n * `SL` - Slovenian\n * `SV` - Swedish\n * `TR` - Turkish\n * `ZH` - Chinese\n\nIf this parameter is omitted, the API will attempt to detect the language of the text and translate it.",
"description": "Language of the text to be translated. Options currently available:\n * `BG` - Bulgarian\n * `CS` - Czech\n * `DA` - Danish\n * `DE` - German\n * `EL` - Greek\n * `EN` - English\n * `ES` - Spanish\n * `ET` - Estonian\n * `FI` - Finnish\n * `FR` - French\n * `HU` - Hungarian\n * `ID` - Indonesian\n * `IT` - Italian\n * `JA` - Japanese\n * `LT` - Lithuanian\n * `LV` - Latvian\n * `NL` - Dutch\n * `PL` - Polish\n * `PT` - Portuguese (all Portuguese varieties mixed)\n * `RO` - Romanian\n * `RU` - Russian\n * `SK` - Slovak\n * `SL` - Slovenian\n * `SV` - Swedish\n * `TR` - Turkish\n * `UK` - Ukrainian\n * `ZH` - Chinese\n\nIf this parameter is omitted, the API will attempt to detect the language of the text and translate it.",
"enum": [
"BG",
"CS",
Expand All @@ -1707,12 +1712,13 @@
"SL",
"SV",
"TR",
"UK",
"ZH"
]
},
"TargetLanguage": {
"type": "string",
"description": "The language into which the text should be translated. Options currently available:\n * `BG` - Bulgarian\n * `CS` - Czech\n * `DA` - Danish\n * `DE` - German\n * `EL` - Greek\n * `EN` - English (unspecified variant for backward compatibility; please select `EN-GB` or `EN-US` instead)\n * `EN-GB` - English (British)\n * `EN-US` - English (American)\n * `ES` - Spanish\n * `ET` - Estonian\n * `FI` - Finnish\n * `FR` - French\n * `HU` - Hungarian\n * `ID` - Indonesian\n * `IT` - Italian\n * `JA` - Japanese\n * `LT` - Lithuanian\n * `LV` - Latvian\n * `NL` - Dutch\n * `PL` - Polish\n * `PT` - Portuguese (unspecified variant for backward compatibility; please select `PT-BR` or `PT-PT` instead)\n * `PT-BR` - Portuguese (Brazilian)\n * `PT-PT` - Portuguese (all Portuguese varieties excluding Brazilian Portuguese)\n * `RO` - Romanian\n * `RU` - Russian\n * `SK` - Slovak\n * `SL` - Slovenian\n * `SV` - Swedish\n * `TR` - Turkish\n * `ZH` - Chinese",
"description": "The language into which the text should be translated. Options currently available:\n * `BG` - Bulgarian\n * `CS` - Czech\n * `DA` - Danish\n * `DE` - German\n * `EL` - Greek\n * `EN` - English (unspecified variant for backward compatibility; please select `EN-GB` or `EN-US` instead)\n * `EN-GB` - English (British)\n * `EN-US` - English (American)\n * `ES` - Spanish\n * `ET` - Estonian\n * `FI` - Finnish\n * `FR` - French\n * `HU` - Hungarian\n * `ID` - Indonesian\n * `IT` - Italian\n * `JA` - Japanese\n * `LT` - Lithuanian\n * `LV` - Latvian\n * `NL` - Dutch\n * `PL` - Polish\n * `PT` - Portuguese (unspecified variant for backward compatibility; please select `PT-BR` or `PT-PT` instead)\n * `PT-BR` - Portuguese (Brazilian)\n * `PT-PT` - Portuguese (all Portuguese varieties excluding Brazilian Portuguese)\n * `RO` - Romanian\n * `RU` - Russian\n * `SK` - Slovak\n * `SL` - Slovenian\n * `SV` - Swedish\n * `TR` - Turkish\n * `UK` - Ukrainian\n * `ZH` - Chinese (simplified)",
"enum": [
"BG",
"CS",
Expand Down Expand Up @@ -1741,6 +1747,7 @@
"SL",
"SV",
"TR",
"UK",
"ZH"
]
}
Expand Down
Loading

0 comments on commit d222b54

Please sign in to comment.