AI-generated Key Takeaways
-
The
Translation
class is the entry point for getting aTranslator
object for language translation. -
You can create a
Translator
instance using thegetClient()
method withTranslatorOptions
specifying the source and target languages. -
To avoid resource leaks, call
close()
on theTranslator
object when it is no longer needed.
Entry point to get a Translator
for
translating from the source language to the target language specified in options
.
An Translator
is
created via
getClient(TranslatorOptions)
.
Example:
Translator translator = Translation.getClient(options);
Public Method Summary
static Translator |
getClient(TranslatorOptions
options)
Returns a new instance of
Translator
that can translate from the source language to the target language (both
specified in options ).
|
Inherited Method Summary
Public Methods
public static Translator getClient (TranslatorOptions options)
Returns a new instance of Translator
that can translate from the source language to the target language (both specified in
options
).
To release the resources associated with a Translator, you need to ensure that
close()
is called on the resulting Translator
object once it will no longer be used.