gcloud alpha ml translate detect-language Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud alpha ml translate detect-language - use the Google Cloud Translation API to detect languages
- SYNOPSIS
gcloud alpha ml translate detect-language(--content=CONTENT|--content-file=CONTENT_FILE)[--mime-type=MIME_TYPE][--model=MODEL][--zone=ZONE; default="global"][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(ALPHA)Detects the language of text in a request.- EXAMPLES
- The following command detects the language of 'What beautiful weather!'
gcloudalphamltranslatedetect-language--content='What beautiful weather!'--zone=us-central1 - REQUIRED FLAGS
- Contents group.
Exactly one of these must be specified:
--content=CONTENT- Content of the input in string format.
--content-file=CONTENT_FILE- Specify a local file path with content.
- Contents group.
- OPTIONAL FLAGS
--mime-type=MIME_TYPE- Format of the source text, for example, 'text/html', 'text/plain'. Defaults to'text/html'.
--model=MODEL- Language detection model to be used. If not specified, the default(language-detection/default) model is used. Authorization requires the followingGoogle IAM permission on the specified resource model:
cloudtranslate.languageDetectionModels.predict
--zone=ZONE; default="global"- Location to make calls. Non-global location is required for requests usingAutoML models. Currently, only 'us-central1' is supported as a non-globallocation. Defaults to 'global'.
- 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
$gcloud helpfor details. - API REFERENCE
- This command uses the
translate/v3beta1API. The full documentationfor this API can be found at:https://cloud.google.com/translate/docs/quickstarts - NOTES
- This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. This variant is also available:
gcloudbetamltranslatedetect-language
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-22 UTC.