Package-level declarations

Types

Link copied to clipboard

Whether the translated text should lean towards formal or informal language. This doesn't work for all target languages.

Link copied to clipboard

Enabled tells DeepL to try to auto-detect the structure of XML input and try to figure out which pieces of text may belong together. Disabled disables this, so you can have more control over tag handling with TagHandling, SplitSentences, and TranslateOptions.splittingTags.

Link copied to clipboard

Yes tells DeepL to try to keep the formatting of the original text, even if it is detected as incorrect by DeepL. No tells DeepL to try to correct formatting mistakes.

Link copied to clipboard

Tells DeepL to split translation texts into sentences and then translate them individually.

Link copied to clipboard

Tells DeepL to try to extract texts out of a structure, translate them individually, and place them back in the same structure.

Link copied to clipboard
data class TranslateOptions(var splitSentences: SplitSentences? = null, var preserveFormatting: PreserveFormatting? = null, var formality: Formality? = null, var tagHandling: TagHandling? = null, var nonSplittingTags: Iterable<String>? = null, var outlineDetection: OutlineDetection? = null, var splittingTags: Iterable<String>? = null, var ignoreTags: Iterable<String>? = null)

For more information about each parameter, check the parameter's type documentation.

Link copied to clipboard
@Serializable
data class TranslateResponse(val translations: List<Translation>)
Link copied to clipboard
@Serializable
data class Translation(val detectedSourceLang: SourceLang, val text: String)