NoOpMessageTranslator

No-op message translation service for platforms without on-device translation capability (F-Droid, Desktop, iOS).

Always reports translation as unavailable, which hides the translate action in the message UI.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open suspend override fun downloadLanguageModels(languageTags: List<String>): DownloadResult

Download the translation models for the given language tags. Only meaningful on google flavor.

Link copied to clipboard
open suspend override fun isLanguageAvailable(locale: String): Boolean

Check whether translating into the given locale is possible on this platform (model downloadable).

Link copied to clipboard
open suspend override fun translate(text: String, targetLocale: String): TranslationResult

Translate plain chat text to the target locale, detecting the source language on-device. Never downloads language models — missing models are reported as TranslationResult.ModelDownloadRequired so the UI can ask the user before pulling ~30MB per language.