diff --git a/Translate/metadata/V3/TranslationService.php b/Translate/metadata/V3/TranslationService.php index bc97c6130b8..f7615d188f3 100644 Binary files a/Translate/metadata/V3/TranslationService.php and b/Translate/metadata/V3/TranslationService.php differ diff --git a/Translate/samples/V3/TranslationServiceClient/batch_translate_document.php b/Translate/samples/V3/TranslationServiceClient/batch_translate_document.php index b17e436d30a..53ea4c08032 100644 --- a/Translate/samples/V3/TranslationServiceClient/batch_translate_document.php +++ b/Translate/samples/V3/TranslationServiceClient/batch_translate_document.php @@ -50,10 +50,10 @@ * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) * error is returned. Please see * {@see TranslationServiceClient::locationName()} for help formatting this field. - * @param string $sourceLanguageCode The BCP-47 language code of the input document if known, for + * @param string $sourceLanguageCode The ISO-639 language code of the input document if known, for * example, "en-US" or "sr-Latn". Supported language codes are listed in - * Language Support (https://cloud.google.com/translate/docs/languages). - * @param string $targetLanguageCodesElement The BCP-47 language code to use for translation of the input + * [Language Support](https://cloud.google.com/translate/docs/languages). + * @param string $targetLanguageCodesElement The ISO-639 language code to use for translation of the input * document. Specify up to 10 language codes here. */ function batch_translate_document_sample( diff --git a/Translate/samples/V3/TranslationServiceClient/translate_document.php b/Translate/samples/V3/TranslationServiceClient/translate_document.php index 9e4edd83703..ab9034650d9 100644 --- a/Translate/samples/V3/TranslationServiceClient/translate_document.php +++ b/Translate/samples/V3/TranslationServiceClient/translate_document.php @@ -43,7 +43,7 @@ * * Models and glossaries must be within the same region (have the same * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - * @param string $targetLanguageCode The BCP-47 language code to use for translation of the input + * @param string $targetLanguageCode The ISO-639 language code to use for translation of the input * document, set to one of the language codes listed in Language Support. */ function translate_document_sample(string $parent, string $targetLanguageCode): void diff --git a/Translate/samples/V3/TranslationServiceClient/translate_text.php b/Translate/samples/V3/TranslationServiceClient/translate_text.php index b4cd16bfd8e..960046525ae 100644 --- a/Translate/samples/V3/TranslationServiceClient/translate_text.php +++ b/Translate/samples/V3/TranslationServiceClient/translate_text.php @@ -31,10 +31,9 @@ * Translates input text and returns translated text. * * @param string $contentsElement The content of the input in string format. - * We recommend the total content be less than 30k codepoints. The max length - * of this field is 1024. - * Use BatchTranslateText for larger text. - * @param string $targetLanguageCode The BCP-47 language code to use for translation of the input + * We recommend the total content be less than 30,000 codepoints. The max + * length of this field is 1024. Use BatchTranslateText for larger text. + * @param string $targetLanguageCode The ISO-639 language code to use for translation of the input * text, set to one of the language codes listed in Language Support. * @param string $formattedParent Project or location to make a call. Must refer to a caller's * project. diff --git a/Translate/src/V3/BatchDocumentOutputConfig.php b/Translate/src/V3/BatchDocumentOutputConfig.php index ba84707c1ab..ae9cab5054d 100644 --- a/Translate/src/V3/BatchDocumentOutputConfig.php +++ b/Translate/src/V3/BatchDocumentOutputConfig.php @@ -50,7 +50,7 @@ class BatchDocumentOutputConfig extends \Google\Protobuf\Internal\Message * Since index.csv will be keeping updated during the process, please make * sure there is no custom retention policy applied on the output bucket * that may avoid file updating. - * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) + * (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) * The naming format of translation output files follows (for target * language code [trg]): `translation_output`: * gs://translation_output/a_b_c_[trg]_translation.[extension] @@ -96,7 +96,7 @@ public function __construct($data = NULL) { * Since index.csv will be keeping updated during the process, please make * sure there is no custom retention policy applied on the output bucket * that may avoid file updating. - * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) + * (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) * The naming format of translation output files follows (for target * language code [trg]): `translation_output`: * gs://translation_output/a_b_c_[trg]_translation.[extension] @@ -149,7 +149,7 @@ public function hasGcsDestination() * Since index.csv will be keeping updated during the process, please make * sure there is no custom retention policy applied on the output bucket * that may avoid file updating. - * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) + * (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) * The naming format of translation output files follows (for target * language code [trg]): `translation_output`: * gs://translation_output/a_b_c_[trg]_translation.[extension] diff --git a/Translate/src/V3/BatchTranslateDocumentRequest.php b/Translate/src/V3/BatchTranslateDocumentRequest.php index 5405b091a27..5c1d8d0c575 100644 --- a/Translate/src/V3/BatchTranslateDocumentRequest.php +++ b/Translate/src/V3/BatchTranslateDocumentRequest.php @@ -27,15 +27,15 @@ class BatchTranslateDocumentRequest extends \Google\Protobuf\Internal\Message */ private $parent = ''; /** - * Required. The BCP-47 language code of the input document if known, for + * Required. The ISO-639 language code of the input document if known, for * example, "en-US" or "sr-Latn". Supported language codes are listed in - * Language Support (https://cloud.google.com/translate/docs/languages). + * [Language Support](https://cloud.google.com/translate/docs/languages). * * Generated from protobuf field string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; */ private $source_language_code = ''; /** - * Required. The BCP-47 language code to use for translation of the input + * Required. The ISO-639 language code to use for translation of the input * document. Specify up to 10 language codes here. * * Generated from protobuf field repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -92,6 +92,15 @@ class BatchTranslateDocumentRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field map format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL]; */ private $format_conversions; + /** + * Optional. This flag is to support user customized attribution. + * If not provided, the default is `Machine Translated by Google`. + * Customized attribution should follow rules in + * https://cloud.google.com/translate/attribution#attribution_and_logos + * + * Generated from protobuf field string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $customized_attribution = ''; /** * Constructor. @@ -107,11 +116,11 @@ class BatchTranslateDocumentRequest extends \Google\Protobuf\Internal\Message * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) * error is returned. * @type string $source_language_code - * Required. The BCP-47 language code of the input document if known, for + * Required. The ISO-639 language code of the input document if known, for * example, "en-US" or "sr-Latn". Supported language codes are listed in - * Language Support (https://cloud.google.com/translate/docs/languages). + * [Language Support](https://cloud.google.com/translate/docs/languages). * @type array|\Google\Protobuf\Internal\RepeatedField $target_language_codes - * Required. The BCP-47 language code to use for translation of the input + * Required. The ISO-639 language code to use for translation of the input * document. Specify up to 10 language codes here. * @type array<\Google\Cloud\Translate\V3\BatchDocumentInputConfig>|\Google\Protobuf\Internal\RepeatedField $input_configs * Required. Input configurations. @@ -144,6 +153,11 @@ class BatchTranslateDocumentRequest extends \Google\Protobuf\Internal\Message * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` * If nothing specified, output files will be in the same format as the * original file. + * @type string $customized_attribution + * Optional. This flag is to support user customized attribution. + * If not provided, the default is `Machine Translated by Google`. + * Customized attribution should follow rules in + * https://cloud.google.com/translate/attribution#attribution_and_logos * } */ public function __construct($data = NULL) { @@ -188,9 +202,9 @@ public function setParent($var) } /** - * Required. The BCP-47 language code of the input document if known, for + * Required. The ISO-639 language code of the input document if known, for * example, "en-US" or "sr-Latn". Supported language codes are listed in - * Language Support (https://cloud.google.com/translate/docs/languages). + * [Language Support](https://cloud.google.com/translate/docs/languages). * * Generated from protobuf field string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -201,9 +215,9 @@ public function getSourceLanguageCode() } /** - * Required. The BCP-47 language code of the input document if known, for + * Required. The ISO-639 language code of the input document if known, for * example, "en-US" or "sr-Latn". Supported language codes are listed in - * Language Support (https://cloud.google.com/translate/docs/languages). + * [Language Support](https://cloud.google.com/translate/docs/languages). * * Generated from protobuf field string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; * @param string $var @@ -218,7 +232,7 @@ public function setSourceLanguageCode($var) } /** - * Required. The BCP-47 language code to use for translation of the input + * Required. The ISO-639 language code to use for translation of the input * document. Specify up to 10 language codes here. * * Generated from protobuf field repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -230,7 +244,7 @@ public function getTargetLanguageCodes() } /** - * Required. The BCP-47 language code to use for translation of the input + * Required. The ISO-639 language code to use for translation of the input * document. Specify up to 10 language codes here. * * Generated from protobuf field repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -427,5 +441,37 @@ public function setFormatConversions($var) return $this; } + /** + * Optional. This flag is to support user customized attribution. + * If not provided, the default is `Machine Translated by Google`. + * Customized attribution should follow rules in + * https://cloud.google.com/translate/attribution#attribution_and_logos + * + * Generated from protobuf field string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCustomizedAttribution() + { + return $this->customized_attribution; + } + + /** + * Optional. This flag is to support user customized attribution. + * If not provided, the default is `Machine Translated by Google`. + * Customized attribution should follow rules in + * https://cloud.google.com/translate/attribution#attribution_and_logos + * + * Generated from protobuf field string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCustomizedAttribution($var) + { + GPBUtil::checkString($var, True); + $this->customized_attribution = $var; + + return $this; + } + } diff --git a/Translate/src/V3/DetectedLanguage.php b/Translate/src/V3/DetectedLanguage.php index 22f07300c9e..8d9d6ee4c48 100644 --- a/Translate/src/V3/DetectedLanguage.php +++ b/Translate/src/V3/DetectedLanguage.php @@ -16,7 +16,7 @@ class DetectedLanguage extends \Google\Protobuf\Internal\Message { /** - * The BCP-47 language code of source content in the request, detected + * The ISO-639 language code of the source content in the request, detected * automatically. * * Generated from protobuf field string language_code = 1; @@ -36,7 +36,7 @@ class DetectedLanguage extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $language_code - * The BCP-47 language code of source content in the request, detected + * The ISO-639 language code of the source content in the request, detected * automatically. * @type float $confidence * The confidence of the detection result for this language. @@ -48,7 +48,7 @@ public function __construct($data = NULL) { } /** - * The BCP-47 language code of source content in the request, detected + * The ISO-639 language code of the source content in the request, detected * automatically. * * Generated from protobuf field string language_code = 1; @@ -60,7 +60,7 @@ public function getLanguageCode() } /** - * The BCP-47 language code of source content in the request, detected + * The ISO-639 language code of the source content in the request, detected * automatically. * * Generated from protobuf field string language_code = 1; diff --git a/Translate/src/V3/Gapic/TranslationServiceGapicClient.php b/Translate/src/V3/Gapic/TranslationServiceGapicClient.php index 79690128af3..c4997f53c63 100644 --- a/Translate/src/V3/Gapic/TranslationServiceGapicClient.php +++ b/Translate/src/V3/Gapic/TranslationServiceGapicClient.php @@ -415,10 +415,10 @@ public function __construct(array $options = []) * Only AutoML Translation models or glossaries within the same region (have * the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) * error is returned. - * @param string $sourceLanguageCode Required. The BCP-47 language code of the input document if known, for + * @param string $sourceLanguageCode Required. The ISO-639 language code of the input document if known, for * example, "en-US" or "sr-Latn". Supported language codes are listed in - * Language Support (https://cloud.google.com/translate/docs/languages). - * @param string[] $targetLanguageCodes Required. The BCP-47 language code to use for translation of the input + * [Language Support](https://cloud.google.com/translate/docs/languages). + * @param string[] $targetLanguageCodes Required. The ISO-639 language code to use for translation of the input * document. Specify up to 10 language codes here. * @param BatchDocumentInputConfig[] $inputConfigs Required. Input configurations. * The total number of files matched should be <= 100. @@ -459,6 +459,11 @@ public function __construct(array $options = []) * * If nothing specified, output files will be in the same format as the * original file. + * @type string $customizedAttribution + * Optional. This flag is to support user customized attribution. + * If not provided, the default is `Machine Translated by Google`. + * Customized attribution should follow rules in + * https://cloud.google.com/translate/attribution#attribution_and_logos * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -491,6 +496,10 @@ public function batchTranslateDocument($parent, $sourceLanguageCode, $targetLang $request->setFormatConversions($optionalArgs['formatConversions']); } + if (isset($optionalArgs['customizedAttribution'])) { + $request->setCustomizedAttribution($optionalArgs['customizedAttribution']); + } + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startOperationsCall('BatchTranslateDocument', $optionalArgs, $request, $this->getOperationsClient())->wait(); @@ -1091,14 +1100,14 @@ public function listGlossaries($parent, array $optionalArgs = []) * * Models and glossaries must be within the same region (have the same * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - * @param string $targetLanguageCode Required. The BCP-47 language code to use for translation of the input + * @param string $targetLanguageCode Required. The ISO-639 language code to use for translation of the input * document, set to one of the language codes listed in Language Support. * @param DocumentInputConfig $documentInputConfig Required. Input configurations. * @param array $optionalArgs { * Optional. * * @type string $sourceLanguageCode - * Optional. The BCP-47 language code of the input document if known, for + * Optional. The ISO-639 language code of the input document if known, for * example, "en-US" or "sr-Latn". Supported language codes are listed in * Language Support. If the source language isn't specified, the API attempts * to identify the source language automatically and returns the source @@ -1138,6 +1147,19 @@ public function listGlossaries($parent, array $optionalArgs = []) * * See https://cloud.google.com/translate/docs/advanced/labels for more * information. + * @type string $customizedAttribution + * Optional. This flag is to support user customized attribution. + * If not provided, the default is `Machine Translated by Google`. + * Customized attribution should follow rules in + * https://cloud.google.com/translate/attribution#attribution_and_logos + * @type bool $isTranslateNativePdfOnly + * Optional. If true, the page limit of online native pdf translation is 300 + * and only native pdf pages will be translated. + * @type bool $enableShadowRemovalNativePdf + * Optional. If true, use the text removal to remove the shadow text on + * background image for native pdf translation. + * Shadow removal feature can only be enabled when + * is_translate_native_pdf_only is false * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -1176,6 +1198,18 @@ public function translateDocument($parent, $targetLanguageCode, $documentInputCo $request->setLabels($optionalArgs['labels']); } + if (isset($optionalArgs['customizedAttribution'])) { + $request->setCustomizedAttribution($optionalArgs['customizedAttribution']); + } + + if (isset($optionalArgs['isTranslateNativePdfOnly'])) { + $request->setIsTranslateNativePdfOnly($optionalArgs['isTranslateNativePdfOnly']); + } + + if (isset($optionalArgs['enableShadowRemovalNativePdf'])) { + $request->setEnableShadowRemovalNativePdf($optionalArgs['enableShadowRemovalNativePdf']); + } + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startCall('TranslateDocument', TranslateDocumentResponse::class, $optionalArgs, $request)->wait(); @@ -1198,10 +1232,9 @@ public function translateDocument($parent, $targetLanguageCode, $documentInputCo * ``` * * @param string[] $contents Required. The content of the input in string format. - * We recommend the total content be less than 30k codepoints. The max length - * of this field is 1024. - * Use BatchTranslateText for larger text. - * @param string $targetLanguageCode Required. The BCP-47 language code to use for translation of the input + * We recommend the total content be less than 30,000 codepoints. The max + * length of this field is 1024. Use BatchTranslateText for larger text. + * @param string $targetLanguageCode Required. The ISO-639 language code to use for translation of the input * text, set to one of the language codes listed in Language Support. * @param string $parent Required. Project or location to make a call. Must refer to a caller's * project. @@ -1224,7 +1257,7 @@ public function translateDocument($parent, $targetLanguageCode, $documentInputCo * Optional. The format of the source text, for example, "text/html", * "text/plain". If left blank, the MIME type defaults to "text/html". * @type string $sourceLanguageCode - * Optional. The BCP-47 language code of the input text if + * Optional. The ISO-639 language code of the input text if * known, for example, "en-US" or "sr-Latn". Supported language codes are * listed in Language Support. If the source language isn't specified, the API * attempts to identify the source language automatically and returns the diff --git a/Translate/src/V3/Glossary.php b/Translate/src/V3/Glossary.php index 5035fe80ea4..74fcad43b5d 100644 --- a/Translate/src/V3/Glossary.php +++ b/Translate/src/V3/Glossary.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Represents a glossary built from user provided data. + * Represents a glossary built from user-provided data. * * Generated from protobuf message google.cloud.translation.v3.Glossary */ @@ -47,6 +47,12 @@ class Glossary extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Timestamp end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $end_time = null; + /** + * Optional. The display name of the glossary. + * + * Generated from protobuf field string display_name = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $display_name = ''; protected $languages; /** @@ -71,6 +77,8 @@ class Glossary extends \Google\Protobuf\Internal\Message * Output only. When CreateGlossary was called. * @type \Google\Protobuf\Timestamp $end_time * Output only. When the glossary creation was finished. + * @type string $display_name + * Optional. The display name of the glossary. * } */ public function __construct($data = NULL) { @@ -304,6 +312,32 @@ public function setEndTime($var) return $this; } + /** + * Optional. The display name of the glossary. + * + * Generated from protobuf field string display_name = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. The display name of the glossary. + * + * Generated from protobuf field string display_name = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + /** * @return string */ diff --git a/Translate/src/V3/Glossary/LanguageCodePair.php b/Translate/src/V3/Glossary/LanguageCodePair.php index 081c37a713b..32fc3faebda 100644 --- a/Translate/src/V3/Glossary/LanguageCodePair.php +++ b/Translate/src/V3/Glossary/LanguageCodePair.php @@ -16,14 +16,14 @@ class LanguageCodePair extends \Google\Protobuf\Internal\Message { /** - * Required. The BCP-47 language code of the input text, for example, + * Required. The ISO-639 language code of the input text, for example, * "en-US". Expected to be an exact match for GlossaryTerm.language_code. * * Generated from protobuf field string source_language_code = 1; */ private $source_language_code = ''; /** - * Required. The BCP-47 language code for translation output, for example, + * Required. The ISO-639 language code for translation output, for example, * "zh-CN". Expected to be an exact match for GlossaryTerm.language_code. * * Generated from protobuf field string target_language_code = 2; @@ -37,10 +37,10 @@ class LanguageCodePair extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $source_language_code - * Required. The BCP-47 language code of the input text, for example, + * Required. The ISO-639 language code of the input text, for example, * "en-US". Expected to be an exact match for GlossaryTerm.language_code. * @type string $target_language_code - * Required. The BCP-47 language code for translation output, for example, + * Required. The ISO-639 language code for translation output, for example, * "zh-CN". Expected to be an exact match for GlossaryTerm.language_code. * } */ @@ -50,7 +50,7 @@ public function __construct($data = NULL) { } /** - * Required. The BCP-47 language code of the input text, for example, + * Required. The ISO-639 language code of the input text, for example, * "en-US". Expected to be an exact match for GlossaryTerm.language_code. * * Generated from protobuf field string source_language_code = 1; @@ -62,7 +62,7 @@ public function getSourceLanguageCode() } /** - * Required. The BCP-47 language code of the input text, for example, + * Required. The ISO-639 language code of the input text, for example, * "en-US". Expected to be an exact match for GlossaryTerm.language_code. * * Generated from protobuf field string source_language_code = 1; @@ -78,7 +78,7 @@ public function setSourceLanguageCode($var) } /** - * Required. The BCP-47 language code for translation output, for example, + * Required. The ISO-639 language code for translation output, for example, * "zh-CN". Expected to be an exact match for GlossaryTerm.language_code. * * Generated from protobuf field string target_language_code = 2; @@ -90,7 +90,7 @@ public function getTargetLanguageCode() } /** - * Required. The BCP-47 language code for translation output, for example, + * Required. The ISO-639 language code for translation output, for example, * "zh-CN". Expected to be an exact match for GlossaryTerm.language_code. * * Generated from protobuf field string target_language_code = 2; diff --git a/Translate/src/V3/Glossary/LanguageCodesSet.php b/Translate/src/V3/Glossary/LanguageCodesSet.php index aa8c14f638b..164d340406c 100644 --- a/Translate/src/V3/Glossary/LanguageCodesSet.php +++ b/Translate/src/V3/Glossary/LanguageCodesSet.php @@ -16,7 +16,7 @@ class LanguageCodesSet extends \Google\Protobuf\Internal\Message { /** - * The BCP-47 language code(s) for terms defined in the glossary. + * The ISO-639 language code(s) for terms defined in the glossary. * All entries are unique. The list contains at least two entries. * Expected to be an exact match for GlossaryTerm.language_code. * @@ -31,7 +31,7 @@ class LanguageCodesSet extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type array|\Google\Protobuf\Internal\RepeatedField $language_codes - * The BCP-47 language code(s) for terms defined in the glossary. + * The ISO-639 language code(s) for terms defined in the glossary. * All entries are unique. The list contains at least two entries. * Expected to be an exact match for GlossaryTerm.language_code. * } @@ -42,7 +42,7 @@ public function __construct($data = NULL) { } /** - * The BCP-47 language code(s) for terms defined in the glossary. + * The ISO-639 language code(s) for terms defined in the glossary. * All entries are unique. The list contains at least two entries. * Expected to be an exact match for GlossaryTerm.language_code. * @@ -55,7 +55,7 @@ public function getLanguageCodes() } /** - * The BCP-47 language code(s) for terms defined in the glossary. + * The ISO-639 language code(s) for terms defined in the glossary. * All entries are unique. The list contains at least two entries. * Expected to be an exact match for GlossaryTerm.language_code. * diff --git a/Translate/src/V3/GlossaryInputConfig.php b/Translate/src/V3/GlossaryInputConfig.php index d1d24714390..a5800834223 100644 --- a/Translate/src/V3/GlossaryInputConfig.php +++ b/Translate/src/V3/GlossaryInputConfig.php @@ -30,10 +30,10 @@ class GlossaryInputConfig extends \Google\Protobuf\Internal\Message * formats. Wildcards are not allowed. This must be a single file in one of * the following formats: * For unidirectional glossaries: - * - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated. + * - TSV/CSV (`.tsv`/`.csv`): Two column file, tab- or comma-separated. * The first column is source text. The second column is target text. - * The file must not contain headers. That is, the first row is data, not - * column names. + * No headers in this file. The first row contains data and not column + * names. * - TMX (`.tmx`): TMX file with parallel data defining source/target term * pairs. * For equivalent term sets glossaries: @@ -54,10 +54,10 @@ public function __construct($data = NULL) { * formats. Wildcards are not allowed. This must be a single file in one of * the following formats: * For unidirectional glossaries: - * - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated. + * - TSV/CSV (`.tsv`/`.csv`): Two column file, tab- or comma-separated. * The first column is source text. The second column is target text. - * The file must not contain headers. That is, the first row is data, not - * column names. + * No headers in this file. The first row contains data and not column + * names. * - TMX (`.tmx`): TMX file with parallel data defining source/target term * pairs. * For equivalent term sets glossaries: @@ -85,10 +85,10 @@ public function hasGcsSource() * formats. Wildcards are not allowed. This must be a single file in one of * the following formats: * For unidirectional glossaries: - * - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated. + * - TSV/CSV (`.tsv`/`.csv`): Two column file, tab- or comma-separated. * The first column is source text. The second column is target text. - * The file must not contain headers. That is, the first row is data, not - * column names. + * No headers in this file. The first row contains data and not column + * names. * - TMX (`.tmx`): TMX file with parallel data defining source/target term * pairs. * For equivalent term sets glossaries: diff --git a/Translate/src/V3/OutputConfig.php b/Translate/src/V3/OutputConfig.php index e6b91925abc..4059eea266f 100644 --- a/Translate/src/V3/OutputConfig.php +++ b/Translate/src/V3/OutputConfig.php @@ -53,7 +53,7 @@ class OutputConfig extends \Google\Protobuf\Internal\Message * Since index.csv will be keeping updated during the process, please make * sure there is no custom retention policy applied on the output bucket * that may avoid file updating. - * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) + * (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) * The format of translations_file (for target language code 'trg') is: * `gs://translation_test/a_b_c_'trg'_translations.[extension]` * If the input file extension is tsv, the output has the following @@ -120,7 +120,7 @@ public function __construct($data = NULL) { * Since index.csv will be keeping updated during the process, please make * sure there is no custom retention policy applied on the output bucket * that may avoid file updating. - * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) + * (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) * The format of translations_file (for target language code 'trg') is: * `gs://translation_test/a_b_c_'trg'_translations.[extension]` * If the input file extension is tsv, the output has the following @@ -194,7 +194,7 @@ public function hasGcsDestination() * Since index.csv will be keeping updated during the process, please make * sure there is no custom retention policy applied on the output bucket * that may avoid file updating. - * (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) + * (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) * The format of translations_file (for target language code 'trg') is: * `gs://translation_test/a_b_c_'trg'_translations.[extension]` * If the input file extension is tsv, the output has the following diff --git a/Translate/src/V3/SupportedLanguage.php b/Translate/src/V3/SupportedLanguage.php index f0492b9eb1b..693d120494d 100644 --- a/Translate/src/V3/SupportedLanguage.php +++ b/Translate/src/V3/SupportedLanguage.php @@ -18,28 +18,28 @@ class SupportedLanguage extends \Google\Protobuf\Internal\Message { /** * Supported language code, generally consisting of its ISO 639-1 - * identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes + * identifier, for example, 'en', 'ja'. In certain cases, ISO-639 codes * including language and region identifiers are returned (for example, - * 'zh-TW' and 'zh-CN') + * 'zh-TW' and 'zh-CN'). * * Generated from protobuf field string language_code = 1; */ private $language_code = ''; /** - * Human readable name of the language localized in the display language + * Human-readable name of the language localized in the display language * specified in the request. * * Generated from protobuf field string display_name = 2; */ private $display_name = ''; /** - * Can be used as source language. + * Can be used as a source language. * * Generated from protobuf field bool support_source = 3; */ private $support_source = false; /** - * Can be used as target language. + * Can be used as a target language. * * Generated from protobuf field bool support_target = 4; */ @@ -53,16 +53,16 @@ class SupportedLanguage extends \Google\Protobuf\Internal\Message * * @type string $language_code * Supported language code, generally consisting of its ISO 639-1 - * identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes + * identifier, for example, 'en', 'ja'. In certain cases, ISO-639 codes * including language and region identifiers are returned (for example, - * 'zh-TW' and 'zh-CN') + * 'zh-TW' and 'zh-CN'). * @type string $display_name - * Human readable name of the language localized in the display language + * Human-readable name of the language localized in the display language * specified in the request. * @type bool $support_source - * Can be used as source language. + * Can be used as a source language. * @type bool $support_target - * Can be used as target language. + * Can be used as a target language. * } */ public function __construct($data = NULL) { @@ -72,9 +72,9 @@ public function __construct($data = NULL) { /** * Supported language code, generally consisting of its ISO 639-1 - * identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes + * identifier, for example, 'en', 'ja'. In certain cases, ISO-639 codes * including language and region identifiers are returned (for example, - * 'zh-TW' and 'zh-CN') + * 'zh-TW' and 'zh-CN'). * * Generated from protobuf field string language_code = 1; * @return string @@ -86,9 +86,9 @@ public function getLanguageCode() /** * Supported language code, generally consisting of its ISO 639-1 - * identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes + * identifier, for example, 'en', 'ja'. In certain cases, ISO-639 codes * including language and region identifiers are returned (for example, - * 'zh-TW' and 'zh-CN') + * 'zh-TW' and 'zh-CN'). * * Generated from protobuf field string language_code = 1; * @param string $var @@ -103,7 +103,7 @@ public function setLanguageCode($var) } /** - * Human readable name of the language localized in the display language + * Human-readable name of the language localized in the display language * specified in the request. * * Generated from protobuf field string display_name = 2; @@ -115,7 +115,7 @@ public function getDisplayName() } /** - * Human readable name of the language localized in the display language + * Human-readable name of the language localized in the display language * specified in the request. * * Generated from protobuf field string display_name = 2; @@ -131,7 +131,7 @@ public function setDisplayName($var) } /** - * Can be used as source language. + * Can be used as a source language. * * Generated from protobuf field bool support_source = 3; * @return bool @@ -142,7 +142,7 @@ public function getSupportSource() } /** - * Can be used as source language. + * Can be used as a source language. * * Generated from protobuf field bool support_source = 3; * @param bool $var @@ -157,7 +157,7 @@ public function setSupportSource($var) } /** - * Can be used as target language. + * Can be used as a target language. * * Generated from protobuf field bool support_target = 4; * @return bool @@ -168,7 +168,7 @@ public function getSupportTarget() } /** - * Can be used as target language. + * Can be used as a target language. * * Generated from protobuf field bool support_target = 4; * @param bool $var diff --git a/Translate/src/V3/TranslateDocumentRequest.php b/Translate/src/V3/TranslateDocumentRequest.php index 4f7e119ab03..214deb092ce 100644 --- a/Translate/src/V3/TranslateDocumentRequest.php +++ b/Translate/src/V3/TranslateDocumentRequest.php @@ -29,7 +29,7 @@ class TranslateDocumentRequest extends \Google\Protobuf\Internal\Message */ private $parent = ''; /** - * Optional. The BCP-47 language code of the input document if known, for + * Optional. The ISO-639 language code of the input document if known, for * example, "en-US" or "sr-Latn". Supported language codes are listed in * Language Support. If the source language isn't specified, the API attempts * to identify the source language automatically and returns the source @@ -40,7 +40,7 @@ class TranslateDocumentRequest extends \Google\Protobuf\Internal\Message */ private $source_language_code = ''; /** - * Required. The BCP-47 language code to use for translation of the input + * Required. The ISO-639 language code to use for translation of the input * document, set to one of the language codes listed in Language Support. * * Generated from protobuf field string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -95,6 +95,31 @@ class TranslateDocumentRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field map labels = 8 [(.google.api.field_behavior) = OPTIONAL]; */ private $labels; + /** + * Optional. This flag is to support user customized attribution. + * If not provided, the default is `Machine Translated by Google`. + * Customized attribution should follow rules in + * https://cloud.google.com/translate/attribution#attribution_and_logos + * + * Generated from protobuf field string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $customized_attribution = ''; + /** + * Optional. If true, the page limit of online native pdf translation is 300 + * and only native pdf pages will be translated. + * + * Generated from protobuf field bool is_translate_native_pdf_only = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $is_translate_native_pdf_only = false; + /** + * Optional. If true, use the text removal to remove the shadow text on + * background image for native pdf translation. + * Shadow removal feature can only be enabled when + * is_translate_native_pdf_only is false + * + * Generated from protobuf field bool enable_shadow_removal_native_pdf = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $enable_shadow_removal_native_pdf = false; /** * Constructor. @@ -112,14 +137,14 @@ class TranslateDocumentRequest extends \Google\Protobuf\Internal\Message * Models and glossaries must be within the same region (have the same * location-id), otherwise an INVALID_ARGUMENT (400) error is returned. * @type string $source_language_code - * Optional. The BCP-47 language code of the input document if known, for + * Optional. The ISO-639 language code of the input document if known, for * example, "en-US" or "sr-Latn". Supported language codes are listed in * Language Support. If the source language isn't specified, the API attempts * to identify the source language automatically and returns the source * language within the response. Source language must be specified if the * request contains a glossary or a custom model. * @type string $target_language_code - * Required. The BCP-47 language code to use for translation of the input + * Required. The ISO-639 language code to use for translation of the input * document, set to one of the language codes listed in Language Support. * @type \Google\Cloud\Translate\V3\DocumentInputConfig $document_input_config * Required. Input configurations. @@ -150,6 +175,19 @@ class TranslateDocumentRequest extends \Google\Protobuf\Internal\Message * are optional. Label keys must start with a letter. * See https://cloud.google.com/translate/docs/advanced/labels for more * information. + * @type string $customized_attribution + * Optional. This flag is to support user customized attribution. + * If not provided, the default is `Machine Translated by Google`. + * Customized attribution should follow rules in + * https://cloud.google.com/translate/attribution#attribution_and_logos + * @type bool $is_translate_native_pdf_only + * Optional. If true, the page limit of online native pdf translation is 300 + * and only native pdf pages will be translated. + * @type bool $enable_shadow_removal_native_pdf + * Optional. If true, use the text removal to remove the shadow text on + * background image for native pdf translation. + * Shadow removal feature can only be enabled when + * is_translate_native_pdf_only is false * } */ public function __construct($data = NULL) { @@ -198,7 +236,7 @@ public function setParent($var) } /** - * Optional. The BCP-47 language code of the input document if known, for + * Optional. The ISO-639 language code of the input document if known, for * example, "en-US" or "sr-Latn". Supported language codes are listed in * Language Support. If the source language isn't specified, the API attempts * to identify the source language automatically and returns the source @@ -214,7 +252,7 @@ public function getSourceLanguageCode() } /** - * Optional. The BCP-47 language code of the input document if known, for + * Optional. The ISO-639 language code of the input document if known, for * example, "en-US" or "sr-Latn". Supported language codes are listed in * Language Support. If the source language isn't specified, the API attempts * to identify the source language automatically and returns the source @@ -234,7 +272,7 @@ public function setSourceLanguageCode($var) } /** - * Required. The BCP-47 language code to use for translation of the input + * Required. The ISO-639 language code to use for translation of the input * document, set to one of the language codes listed in Language Support. * * Generated from protobuf field string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -246,7 +284,7 @@ public function getTargetLanguageCode() } /** - * Required. The BCP-47 language code to use for translation of the input + * Required. The ISO-639 language code to use for translation of the input * document, set to one of the language codes listed in Language Support. * * Generated from protobuf field string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -459,5 +497,97 @@ public function setLabels($var) return $this; } + /** + * Optional. This flag is to support user customized attribution. + * If not provided, the default is `Machine Translated by Google`. + * Customized attribution should follow rules in + * https://cloud.google.com/translate/attribution#attribution_and_logos + * + * Generated from protobuf field string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCustomizedAttribution() + { + return $this->customized_attribution; + } + + /** + * Optional. This flag is to support user customized attribution. + * If not provided, the default is `Machine Translated by Google`. + * Customized attribution should follow rules in + * https://cloud.google.com/translate/attribution#attribution_and_logos + * + * Generated from protobuf field string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCustomizedAttribution($var) + { + GPBUtil::checkString($var, True); + $this->customized_attribution = $var; + + return $this; + } + + /** + * Optional. If true, the page limit of online native pdf translation is 300 + * and only native pdf pages will be translated. + * + * Generated from protobuf field bool is_translate_native_pdf_only = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getIsTranslateNativePdfOnly() + { + return $this->is_translate_native_pdf_only; + } + + /** + * Optional. If true, the page limit of online native pdf translation is 300 + * and only native pdf pages will be translated. + * + * Generated from protobuf field bool is_translate_native_pdf_only = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setIsTranslateNativePdfOnly($var) + { + GPBUtil::checkBool($var); + $this->is_translate_native_pdf_only = $var; + + return $this; + } + + /** + * Optional. If true, use the text removal to remove the shadow text on + * background image for native pdf translation. + * Shadow removal feature can only be enabled when + * is_translate_native_pdf_only is false + * + * Generated from protobuf field bool enable_shadow_removal_native_pdf = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableShadowRemovalNativePdf() + { + return $this->enable_shadow_removal_native_pdf; + } + + /** + * Optional. If true, use the text removal to remove the shadow text on + * background image for native pdf translation. + * Shadow removal feature can only be enabled when + * is_translate_native_pdf_only is false + * + * Generated from protobuf field bool enable_shadow_removal_native_pdf = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableShadowRemovalNativePdf($var) + { + GPBUtil::checkBool($var); + $this->enable_shadow_removal_native_pdf = $var; + + return $this; + } + } diff --git a/Translate/src/V3/TranslateTextGlossaryConfig.php b/Translate/src/V3/TranslateTextGlossaryConfig.php index 309e29da807..b5a3f07f69e 100644 --- a/Translate/src/V3/TranslateTextGlossaryConfig.php +++ b/Translate/src/V3/TranslateTextGlossaryConfig.php @@ -18,16 +18,16 @@ class TranslateTextGlossaryConfig extends \Google\Protobuf\Internal\Message { /** * Required. The `glossary` to be applied for this translation. - * The format depends on glossary: - * - User provided custom glossary: + * The format depends on the glossary: + * - User-provided custom glossary: * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}` * * Generated from protobuf field string glossary = 1 [(.google.api.field_behavior) = REQUIRED]; */ private $glossary = ''; /** - * Optional. Indicates match is case-insensitive. - * Default value is false if missing. + * Optional. Indicates match is case insensitive. The default value is `false` + * if missing. * * Generated from protobuf field bool ignore_case = 2 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -41,12 +41,12 @@ class TranslateTextGlossaryConfig extends \Google\Protobuf\Internal\Message * * @type string $glossary * Required. The `glossary` to be applied for this translation. - * The format depends on glossary: - * - User provided custom glossary: + * The format depends on the glossary: + * - User-provided custom glossary: * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}` * @type bool $ignore_case - * Optional. Indicates match is case-insensitive. - * Default value is false if missing. + * Optional. Indicates match is case insensitive. The default value is `false` + * if missing. * } */ public function __construct($data = NULL) { @@ -56,8 +56,8 @@ public function __construct($data = NULL) { /** * Required. The `glossary` to be applied for this translation. - * The format depends on glossary: - * - User provided custom glossary: + * The format depends on the glossary: + * - User-provided custom glossary: * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}` * * Generated from protobuf field string glossary = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -70,8 +70,8 @@ public function getGlossary() /** * Required. The `glossary` to be applied for this translation. - * The format depends on glossary: - * - User provided custom glossary: + * The format depends on the glossary: + * - User-provided custom glossary: * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}` * * Generated from protobuf field string glossary = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -87,8 +87,8 @@ public function setGlossary($var) } /** - * Optional. Indicates match is case-insensitive. - * Default value is false if missing. + * Optional. Indicates match is case insensitive. The default value is `false` + * if missing. * * Generated from protobuf field bool ignore_case = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -99,8 +99,8 @@ public function getIgnoreCase() } /** - * Optional. Indicates match is case-insensitive. - * Default value is false if missing. + * Optional. Indicates match is case insensitive. The default value is `false` + * if missing. * * Generated from protobuf field bool ignore_case = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/Translate/src/V3/TranslateTextRequest.php b/Translate/src/V3/TranslateTextRequest.php index 7efcc52db44..bb5858479eb 100644 --- a/Translate/src/V3/TranslateTextRequest.php +++ b/Translate/src/V3/TranslateTextRequest.php @@ -17,9 +17,8 @@ class TranslateTextRequest extends \Google\Protobuf\Internal\Message { /** * Required. The content of the input in string format. - * We recommend the total content be less than 30k codepoints. The max length - * of this field is 1024. - * Use BatchTranslateText for larger text. + * We recommend the total content be less than 30,000 codepoints. The max + * length of this field is 1024. Use BatchTranslateText for larger text. * * Generated from protobuf field repeated string contents = 1 [(.google.api.field_behavior) = REQUIRED]; */ @@ -32,7 +31,7 @@ class TranslateTextRequest extends \Google\Protobuf\Internal\Message */ private $mime_type = ''; /** - * Optional. The BCP-47 language code of the input text if + * Optional. The ISO-639 language code of the input text if * known, for example, "en-US" or "sr-Latn". Supported language codes are * listed in Language Support. If the source language isn't specified, the API * attempts to identify the source language automatically and returns the @@ -42,7 +41,7 @@ class TranslateTextRequest extends \Google\Protobuf\Internal\Message */ private $source_language_code = ''; /** - * Required. The BCP-47 language code to use for translation of the input + * Required. The ISO-639 language code to use for translation of the input * text, set to one of the language codes listed in Language Support. * * Generated from protobuf field string target_language_code = 5 [(.google.api.field_behavior) = REQUIRED]; @@ -107,20 +106,19 @@ class TranslateTextRequest extends \Google\Protobuf\Internal\Message * * @type array|\Google\Protobuf\Internal\RepeatedField $contents * Required. The content of the input in string format. - * We recommend the total content be less than 30k codepoints. The max length - * of this field is 1024. - * Use BatchTranslateText for larger text. + * We recommend the total content be less than 30,000 codepoints. The max + * length of this field is 1024. Use BatchTranslateText for larger text. * @type string $mime_type * Optional. The format of the source text, for example, "text/html", * "text/plain". If left blank, the MIME type defaults to "text/html". * @type string $source_language_code - * Optional. The BCP-47 language code of the input text if + * Optional. The ISO-639 language code of the input text if * known, for example, "en-US" or "sr-Latn". Supported language codes are * listed in Language Support. If the source language isn't specified, the API * attempts to identify the source language automatically and returns the * source language within the response. * @type string $target_language_code - * Required. The BCP-47 language code to use for translation of the input + * Required. The ISO-639 language code to use for translation of the input * text, set to one of the language codes listed in Language Support. * @type string $parent * Required. Project or location to make a call. Must refer to a caller's @@ -165,9 +163,8 @@ public function __construct($data = NULL) { /** * Required. The content of the input in string format. - * We recommend the total content be less than 30k codepoints. The max length - * of this field is 1024. - * Use BatchTranslateText for larger text. + * We recommend the total content be less than 30,000 codepoints. The max + * length of this field is 1024. Use BatchTranslateText for larger text. * * Generated from protobuf field repeated string contents = 1 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Protobuf\Internal\RepeatedField @@ -179,9 +176,8 @@ public function getContents() /** * Required. The content of the input in string format. - * We recommend the total content be less than 30k codepoints. The max length - * of this field is 1024. - * Use BatchTranslateText for larger text. + * We recommend the total content be less than 30,000 codepoints. The max + * length of this field is 1024. Use BatchTranslateText for larger text. * * Generated from protobuf field repeated string contents = 1 [(.google.api.field_behavior) = REQUIRED]; * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -224,7 +220,7 @@ public function setMimeType($var) } /** - * Optional. The BCP-47 language code of the input text if + * Optional. The ISO-639 language code of the input text if * known, for example, "en-US" or "sr-Latn". Supported language codes are * listed in Language Support. If the source language isn't specified, the API * attempts to identify the source language automatically and returns the @@ -239,7 +235,7 @@ public function getSourceLanguageCode() } /** - * Optional. The BCP-47 language code of the input text if + * Optional. The ISO-639 language code of the input text if * known, for example, "en-US" or "sr-Latn". Supported language codes are * listed in Language Support. If the source language isn't specified, the API * attempts to identify the source language automatically and returns the @@ -258,7 +254,7 @@ public function setSourceLanguageCode($var) } /** - * Required. The BCP-47 language code to use for translation of the input + * Required. The ISO-639 language code to use for translation of the input * text, set to one of the language codes listed in Language Support. * * Generated from protobuf field string target_language_code = 5 [(.google.api.field_behavior) = REQUIRED]; @@ -270,7 +266,7 @@ public function getTargetLanguageCode() } /** - * Required. The BCP-47 language code to use for translation of the input + * Required. The ISO-639 language code to use for translation of the input * text, set to one of the language codes listed in Language Support. * * Generated from protobuf field string target_language_code = 5 [(.google.api.field_behavior) = REQUIRED]; diff --git a/Translate/src/V3/Translation.php b/Translate/src/V3/Translation.php index 2ecc3ab81fb..82722a76ebe 100644 --- a/Translate/src/V3/Translation.php +++ b/Translate/src/V3/Translation.php @@ -36,7 +36,7 @@ class Translation extends \Google\Protobuf\Internal\Message */ private $model = ''; /** - * The BCP-47 language code of source text in the initial request, detected + * The ISO-639 language code of source text in the initial request, detected * automatically, if no source language was passed within the initial * request. If the source language was passed, auto-detection of the language * does not occur and this field is empty. @@ -70,7 +70,7 @@ class Translation extends \Google\Protobuf\Internal\Message * `model` here would be normalized to * `projects/{project-number}/locations/{location-id}/models/general/nmt`. * @type string $detected_language_code - * The BCP-47 language code of source text in the initial request, detected + * The ISO-639 language code of source text in the initial request, detected * automatically, if no source language was passed within the initial * request. If the source language was passed, auto-detection of the language * does not occur and this field is empty. @@ -152,7 +152,7 @@ public function setModel($var) } /** - * The BCP-47 language code of source text in the initial request, detected + * The ISO-639 language code of source text in the initial request, detected * automatically, if no source language was passed within the initial * request. If the source language was passed, auto-detection of the language * does not occur and this field is empty. @@ -166,7 +166,7 @@ public function getDetectedLanguageCode() } /** - * The BCP-47 language code of source text in the initial request, detected + * The ISO-639 language code of source text in the initial request, detected * automatically, if no source language was passed within the initial * request. If the source language was passed, auto-detection of the language * does not occur and this field is empty. diff --git a/Translate/tests/Unit/V3/TranslationServiceClientTest.php b/Translate/tests/Unit/V3/TranslationServiceClientTest.php index 7e833c2cae0..da38d3bf29b 100644 --- a/Translate/tests/Unit/V3/TranslationServiceClientTest.php +++ b/Translate/tests/Unit/V3/TranslationServiceClientTest.php @@ -385,9 +385,11 @@ public function createGlossaryTest() $transport->addResponse($incompleteOperation); $name = 'name3373707'; $entryCount = 811131134; + $displayName = 'displayName1615086568'; $expectedResponse = new Glossary(); $expectedResponse->setName($name); $expectedResponse->setEntryCount($entryCount); + $expectedResponse->setDisplayName($displayName); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -679,9 +681,11 @@ public function getGlossaryTest() // Mock response $name2 = 'name2-1052831874'; $entryCount = 811131134; + $displayName = 'displayName1615086568'; $expectedResponse = new Glossary(); $expectedResponse->setName($name2); $expectedResponse->setEntryCount($entryCount); + $expectedResponse->setDisplayName($displayName); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->glossaryName('[PROJECT]', '[LOCATION]', '[GLOSSARY]');