MetaPhrase

An open source translation editor for native mobile app localization.

View project on GitHub

//MetaPhrase/com.github.diegoberaldin.metaphrase.domain.mt.repository/MachineTranslationRepository

MachineTranslationRepository

[jvm]
interface MachineTranslationRepository

Contract for the machine translation repository.

Types

Name Summary
Companion [jvm]
object Companion

Functions

Name Summary
generateKey [jvm]
abstract suspend fun generateKey(provider: MachineTranslationProvider = MachineTranslationProvider.MY_MEMORY, username: String, password: String): String
Generate an API key for a machine translation provider. This is supported only by some providers, e.g. MachineTranslationProvider.MY_MEMORY
getTranslation [jvm]
abstract suspend fun getTranslation(provider: MachineTranslationProvider = MachineTranslationProvider.MY_MEMORY, key: String? = null, sourceMessage: String, sourceLang: String, targetLang: String): String
Get a suggestion (translation) from machine translation.
importTm [jvm]
abstract suspend fun importTm(provider: MachineTranslationProvider = MachineTranslationProvider.MY_MEMORY, file: File, key: String? = null, private: Boolean = false, name: String? = null, subject: String? = null)
Contribute a whole TMX file to the remote service. This implies transferring data to a third party engine, so handle with care.
shareTranslation [jvm]
abstract suspend fun shareTranslation(provider: MachineTranslationProvider = MachineTranslationProvider.MY_MEMORY, key: String? = null, sourceMessage: String, sourceLang: String, targetMessage: String, targetLang: String)
Share a translation with the machine translation provider i.e. contribute a segment to the remote TM. This implies transferring data to a third party engine, so handle with care.