AI-generated Key Takeaways
-
The Language service enables automatic text translation within scripts.
-
It uses the
LanguageApp
class and methods liketranslate()
to perform the translations. -
You can specify the source and target languages for translation using language codes like 'en' for English and 'es' for Spanish.
This service allows scripts to automatically translate text.
// The code below will write 'Esta es una prueba' to the log.
var spanish = LanguageApp.translate('This is a test', 'en', 'es');
Logger.log(spanish);
Classes
Name | Brief description |
---|---|
Language | The Language service provides scripts a way to compute automatic translations of text. |
LanguageApp
Methods
Method | Return type | Brief description |
---|---|---|
translate(text, sourceLanguage, targetLanguage) | String | Automatically translates some text from a source language to a destination language. |
translate(text, sourceLanguage, targetLanguage, advancedArgs) | String | Automatically translates some text from a source language to a destination language. |