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/lib/surface/ml/translate/translate_text.yaml
- release_tracks: [ALPHA, BETA]
  help_text:
    brief: Use the Google Cloud Translation API to translate between languages.
    description: |
      Translates input text and returns translated text.
    examples: |
      The following command translates 'What beautiful weather!' into French.

        $ {command} --content='What beautiful weather!' --zone=us-central1 --target-language=fr-CA

  request:
    collection: translate.projects.locations
    method: translateText
    BETA:
      api_version: v3
    ALPHA:
      api_version: v3beta1
    modify_request_hooks:
    - googlecloudsdk.command_lib.ml.translate.hooks:UpdateRequestTranslateText

  arguments:
    resource:
      help_text: endpoint location
      spec: !REF googlecloudsdk.command_lib.ml.translate.resources:project
      override_resource_collection: true

    params:
    - _REF_: googlecloudsdk.command_lib.ml.translate.flags:zone
    - arg_name: model
      help_text: |
        The model type requested for this translation. The format depends on the model type:

          for AutoML Translation models: model-id

          for General (built-in) models: general/nmt or general/base

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

          cloudtranslate.generalModels.predict

          automl.models.predict

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

        Usage:

        AutoML models: '--model=TRL321456789'

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

    - group:
        mutex: true
        required: true
        help_text: Contents group.
        params:
        - arg_name: content
          help_text: |
            The content of the input in string format. We recommend that the content be less
            than 30k codepoints.
        - arg_name: content-file
          help_text: |
            Specify a local file path containing the text to be translated.
    - arg_name: target-language
      required: true
      help_text: |
        The BCP-47 language code to use for translation of the input text.
    - arg_name: source-language
      help_text: |
        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.
    - arg_name: glossary-config
      help_text: |
        Glossary to be applied. The glossary must be within the same region as the model.
    - arg_name: mime-type
      help_text: |
        The format of the source text, for example, 'text/html', 'text/plain'. Defaults to
        'text/html'.