diff --git a/app/src/main/java/com/bnyro/translate/api/lv/LVEngine.kt b/app/src/main/java/com/bnyro/translate/api/lv/LVEngine.kt index ebc874450..371a76cfb 100644 --- a/app/src/main/java/com/bnyro/translate/api/lv/LVEngine.kt +++ b/app/src/main/java/com/bnyro/translate/api/lv/LVEngine.kt @@ -37,6 +37,7 @@ class LVEngine : TranslationEngine( return Translation( translatedText = URLHelper.decodeURL(response.translation), detectedLanguage = response.info?.detectedSource, + transliterations = listOf(response.info?.pronunciation?.query).filterNotNull(), examples = response.info?.examples, similar = response.info?.similar, definitions = response.info?.definitions diff --git a/app/src/main/java/com/bnyro/translate/obj/Translation.kt b/app/src/main/java/com/bnyro/translate/obj/Translation.kt index 10a951dde..c63bec899 100644 --- a/app/src/main/java/com/bnyro/translate/obj/Translation.kt +++ b/app/src/main/java/com/bnyro/translate/obj/Translation.kt @@ -3,6 +3,7 @@ package com.bnyro.translate.obj data class Translation( val translatedText: String, val detectedLanguage: String? = null, + val transliterations: List? = null, val definitions: List? = null, val similar: List? = null, val examples: List? = null diff --git a/app/src/main/java/com/bnyro/translate/ui/views/AdditionalInfoComponent.kt b/app/src/main/java/com/bnyro/translate/ui/views/AdditionalInfoComponent.kt index 90504dffc..0bb80e9a5 100644 --- a/app/src/main/java/com/bnyro/translate/ui/views/AdditionalInfoComponent.kt +++ b/app/src/main/java/com/bnyro/translate/ui/views/AdditionalInfoComponent.kt @@ -46,6 +46,14 @@ fun AdditionalInfoComponent( ) } } + translation.transliterations?.let { + items(it) { + AdditionalInfo( + title = stringResource(R.string.transliteration), + text = it + ) + } + } translation.definitions?.let { items(it) { AdditionalInfo( diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 192eece82..50a50e484 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -57,6 +57,7 @@ Definition Example Similar + Transliteration Search \ No newline at end of file