HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/396/help/man/man1/gcloud_beta_ml_translate_translate-text.1
.TH "GCLOUD_BETA_ML_TRANSLATE_TRANSLATE\-TEXT" 1



.SH "NAME"
.HP
gcloud beta ml translate translate\-text \- use the Google Cloud Translation API to translate between languages



.SH "SYNOPSIS"
.HP
\f5gcloud beta ml translate translate\-text\fR \fB\-\-target\-language\fR=\fITARGET_LANGUAGE\fR (\fB\-\-content\fR=\fICONTENT\fR\ |\ \fB\-\-content\-file\fR=\fICONTENT_FILE\fR) [\fB\-\-glossary\-config\fR=\fIGLOSSARY_CONFIG\fR] [\fB\-\-mime\-type\fR=\fIMIME_TYPE\fR] [\fB\-\-model\fR=\fIMODEL\fR] [\fB\-\-source\-language\fR=\fISOURCE_LANGUAGE\fR] [\fB\-\-zone\fR=\fIZONE\fR;\ default="global"] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

\fB(BETA)\fR Translates input text and returns translated text.



.SH "EXAMPLES"

The following command translates 'What beautiful weather!' into French.

.RS 2m
$ gcloud beta ml translate translate\-text \e
    \-\-content='What beautiful weather!' \-\-zone=us\-central1 \e
    \-\-target\-language=fr\-CA
.RE



.SH "REQUIRED FLAGS"

.RS 2m
.TP 2m
\fB\-\-target\-language\fR=\fITARGET_LANGUAGE\fR

The BCP\-47 language code to use for translation of the input text.

.TP 2m

Contents group.

Exactly one of these must be specified:


.RS 2m
.TP 2m
\fB\-\-content\fR=\fICONTENT\fR

The content of the input in string format. We recommend that the content be less
than 30k codepoints.

.TP 2m
\fB\-\-content\-file\fR=\fICONTENT_FILE\fR

Specify a local file path containing the text to be translated.


.RE
.RE
.sp

.SH "OPTIONAL FLAGS"

.RS 2m
.TP 2m
\fB\-\-glossary\-config\fR=\fIGLOSSARY_CONFIG\fR

Glossary to be applied. The glossary must be within the same region as the
model.

.TP 2m
\fB\-\-mime\-type\fR=\fIMIME_TYPE\fR

The format of the source text, for example, 'text/html', 'text/plain'. Defaults
to 'text/html'.

.TP 2m
\fB\-\-model\fR=\fIMODEL\fR

The model type requested for this translation. The format depends on the model
type:

.RS 2m
for AutoML Translation models: model\-id
.RE

.RS 2m
for General (built\-in) models: general/nmt or general/base
.RE

Authorization requires one or more of the following Google IAM permissions on
the specified resource model:

.RS 2m
cloudtranslate.generalModels.predict
.RE

.RS 2m
automl.models.predict
.RE

If missing, the system decides which google base model to use.

Usage:

AutoML models: '\-\-model=TRL321456789'

General models: '\-\-model=general/nmt'

.TP 2m
\fB\-\-source\-language\fR=\fISOURCE_LANGUAGE\fR

The BCP\-47 language code of the input text if known, for example, 'en\-US' or
\'sr\-Latn'. If the source language isn't specified, the API attempts to
identify the source language automatically and returns the source language in
the response.

.TP 2m
\fB\-\-zone\fR=\fIZONE\fR; default="global"

Location to make calls. Non\-global location is required for requests using
AutoML models. Currently, only 'us\-central1' is supported as a non\-global
location. Defaults to 'global'.


.RE
.sp

.SH "GCLOUD WIDE FLAGS"

These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.

Run \fB$ gcloud help\fR for details.



.SH "API REFERENCE"

This command uses the \fBtranslate/v3\fR API. The full documentation for this
API can be found at: https://cloud.google.com/translate/docs/quickstarts



.SH "NOTES"

This command is currently in beta and might change without notice. This variant
is also available:

.RS 2m
$ gcloud alpha ml translate translate\-text
.RE