Downloads the model files required for translation, if they are not already present.
The download will be triggered as soon as there is a network connection, with no other
conditions.
Returns
A Task
that will be completed when the required files have been downloaded.
Translates the given input from the source language into the target
language. Source and target languages are provided in the
options object that was used to get the instance.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-08-14 UTC."],[],[],null,["# FirebaseTranslator\n\npublic class **FirebaseTranslator** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Closeable](//developer.android.com/reference/java/io/Closeable.html) \n**This class is deprecated.** \n\nThe standalone ML Kit SDK replaces this API. For more information, refer to the [migration guide](//developers.google.com/ml-kit/migration).\n\nEntry point for Translation.\n\nThis class can be used from any thread. \n\n### Public Method Summary\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| void | [close](/docs/reference/android/com/google/firebase/ml/naturallanguage/translate/FirebaseTranslator#close())() Closes the translator object and releases any system resources associated with it. |\n| [Task](//developers.google.com/android/reference/com/google/android/gms/tasks/Task.html)\\\u003c[Void](//developer.android.com/reference/java/lang/Void.html)\\\u003e | [downloadModelIfNeeded](/docs/reference/android/com/google/firebase/ml/naturallanguage/translate/FirebaseTranslator#downloadModelIfNeeded())() Downloads the model files required for translation, if they are not already present. |\n| [Task](//developers.google.com/android/reference/com/google/android/gms/tasks/Task.html)\\\u003c[Void](//developer.android.com/reference/java/lang/Void.html)\\\u003e | [downloadModelIfNeeded](/docs/reference/android/com/google/firebase/ml/naturallanguage/translate/FirebaseTranslator#downloadModelIfNeeded(com.google.firebase.ml.common.modeldownload.FirebaseModelDownloadConditions))([FirebaseModelDownloadConditions](/docs/reference/android/com/google/firebase/ml/common/modeldownload/FirebaseModelDownloadConditions) conditions) Downloads the model files required for translation, if they are not already present, when the given `conditions` are met. |\n| [Task](//developers.google.com/android/reference/com/google/android/gms/tasks/Task.html)\\\u003c[String](//developer.android.com/reference/java/lang/String.html)\\\u003e | [translate](/docs/reference/android/com/google/firebase/ml/naturallanguage/translate/FirebaseTranslator#translate(java.lang.String))([String](//developer.android.com/reference/java/lang/String.html) input) Translates the given `input` from the source language into the target language. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface java.io.Closeable \n\n|---------------|---------|\n| abstract void | close() |\n\nFrom interface java.lang.AutoCloseable \n\n|---------------|---------|\n| abstract void | close() |\n\nPublic Methods\n--------------\n\n#### public void **close** ()\n\nCloses the translator object and releases any system resources associated with\nit. \n\n#### public [Task](//developers.google.com/android/reference/com/google/android/gms/tasks/Task.html)\\\u003c[Void](//developer.android.com/reference/java/lang/Void.html)\\\u003e\n**downloadModelIfNeeded** ()\n\nDownloads the model files required for translation, if they are not already present.\nThe download will be triggered as soon as there is a network connection, with no other\nconditions. \n\n##### Returns\n\n- A [Task](//developers.google.com/android/reference/com/google/android/gms/tasks/Task.html) that will be completed when the required files have been downloaded. \n\n#### public [Task](//developers.google.com/android/reference/com/google/android/gms/tasks/Task.html)\\\u003c[Void](//developer.android.com/reference/java/lang/Void.html)\\\u003e\n**downloadModelIfNeeded** ([FirebaseModelDownloadConditions](/docs/reference/android/com/google/firebase/ml/common/modeldownload/FirebaseModelDownloadConditions) conditions)\n\nDownloads the model files required for translation, if they are not already present,\nwhen the given `conditions` are met. \n\n##### Returns\n\n- A [Task](//developers.google.com/android/reference/com/google/android/gms/tasks/Task.html) that will be completed when the required files have been downloaded. \n\n#### public [Task](//developers.google.com/android/reference/com/google/android/gms/tasks/Task.html)\\\u003c[String](//developer.android.com/reference/java/lang/String.html)\\\u003e\n**translate** ([String](//developer.android.com/reference/java/lang/String.html) input)\n\nTranslates the given `input` from the source language into the target\nlanguage. Source and target languages are provided in the [options](/docs/reference/android/com/google/firebase/ml/naturallanguage/translate/FirebaseTranslatorOptions) object that was used to get the instance. \n\n##### Parameters\n\n| input | A string in the source language |\n|-------|---------------------------------|\n\n##### Returns\n\n- The translated string in the target language"]]