Language Service

  • The Language service enables scripts to automatically translate text.

  • The LanguageApp class provides methods for translating text.

  • The translate method is used to translate text from a source language to a target language.

Language

This service allows scripts to automatically translate text.

//Thecodebelowwillwrite'Esta es una prueba'tothelog.
varspanish=LanguageApp.translate('This is a test','en','es');
Logger.log(spanish);

Classes

NameBrief description
LanguageApp The Language service provides scripts a way to compute automatic translations of text.

LanguageApp

Methods

MethodReturn typeBrief description
translate(text, sourceLanguage, targetLanguage) StringAutomatically translates some text from a source language to a destination language.
translate(text, sourceLanguage, targetLanguage, advancedArgs) StringAutomatically translates some text from a source language to a destination language.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024年12月02日 UTC.