Optional. Google Cloud Storage destination for the translation output, e.g., gs://my_bucket/my_directory/. The destination directory provided does not have to be empty, but the bucket must exist. If a file with the same name as the output file already exists in the destination an error will be returned. For a DocumentInputConfig.contents provided document, the output file will have the name "output_[trg]translations.[ext]", where - [trg] corresponds to the translated file's language code, - [ext] corresponds to the translated file's extension according to its mime type. For a DocumentInputConfig.gcs_uri provided document, the output file will have a name according to its URI. For example: an input file with URI: gs://a/b/c.[extension] stored in a gcs_destination bucket with name "my_bucket" will have an output URI: `gs://my_bucket/a_b_c[trg]translations.[ext], where - [trg] corresponds to the translated file's language code, - [ext] corresponds to the translated file's extension according to its mime type. If the document was directly provided through the request, then the output document will have the format:gs://my_bucket/translated_document[trg]translations.[ext], where - [trg] corresponds to the translated file's language code, - [ext] corresponds to the translated file's extension according to its mime type. If a glossary was provided, then the output URI for the glossary translation will be equal to the default output URI but haveglossary_translationsinstead oftranslations. For the previous example, its glossary URI would be:gs://my_bucket/a_b_c[trg]_glossary_translations.[ext]`. Thus the max number of output files will be 2 (Translated document, Glossary translated document). Callers should expect no partial outputs. If there is any error during document translation, no output will be stored in the Cloud Storage bucket.
↳ mime_type
string
Optional. Specifies the translated document's mime_type. If not specified, the translated file's mime type will be the same as the input file's mime type. Currently only support the output mime type to be the same as input mime type. - application/pdf - application/vnd.openxmlformats-officedocument.wordprocessingml.document - application/vnd.openxmlformats-officedocument.presentationml.presentation - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
getGcsDestination
Optional. Google Cloud Storage destination for the translation output,
e.g., gs://my_bucket/my_directory/.
The destination directory provided does not have to be empty, but the
bucket must exist. If a file with the same name as the output file
already exists in the destination an error will be returned.
For a DocumentInputConfig.contents provided document, the output file
will have the name "output_[trg]_translations.[ext]", where
[trg] corresponds to the translated file's language code,
[ext] corresponds to the translated file's extension according to its
mime type.
For a DocumentInputConfig.gcs_uri provided document, the output file will
have a name according to its URI. For example: an input file with URI:
gs://a/b/c.[extension] stored in a gcs_destination bucket with name
"my_bucket" will have an output URI:
gs://my_bucket/a_b_c_[trg]_translations.[ext], where
[trg] corresponds to the translated file's language code,
[ext] corresponds to the translated file's extension according to its
mime type.
If the document was directly provided through the request, then the
output document will have the format:
gs://my_bucket/translated_document_[trg]_translations.[ext], where
[trg] corresponds to the translated file's language code,
[ext] corresponds to the translated file's extension according to its
mime type.
If a glossary was provided, then the output URI for the glossary
translation will be equal to the default output URI but have
glossary_translations instead of translations. For the previous
example, its glossary URI would be:
gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext].
Thus the max number of output files will be 2 (Translated document,
Glossary translated document).
Callers should expect no partial outputs. If there is any error during
document translation, no output will be stored in the Cloud Storage
bucket.
Optional. Google Cloud Storage destination for the translation output,
e.g., gs://my_bucket/my_directory/.
The destination directory provided does not have to be empty, but the
bucket must exist. If a file with the same name as the output file
already exists in the destination an error will be returned.
For a DocumentInputConfig.contents provided document, the output file
will have the name "output_[trg]_translations.[ext]", where
[trg] corresponds to the translated file's language code,
[ext] corresponds to the translated file's extension according to its
mime type.
For a DocumentInputConfig.gcs_uri provided document, the output file will
have a name according to its URI. For example: an input file with URI:
gs://a/b/c.[extension] stored in a gcs_destination bucket with name
"my_bucket" will have an output URI:
gs://my_bucket/a_b_c_[trg]_translations.[ext], where
[trg] corresponds to the translated file's language code,
[ext] corresponds to the translated file's extension according to its
mime type.
If the document was directly provided through the request, then the
output document will have the format:
gs://my_bucket/translated_document_[trg]_translations.[ext], where
[trg] corresponds to the translated file's language code,
[ext] corresponds to the translated file's extension according to its
mime type.
If a glossary was provided, then the output URI for the glossary
translation will be equal to the default output URI but have
glossary_translations instead of translations. For the previous
example, its glossary URI would be:
gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext].
Thus the max number of output files will be 2 (Translated document,
Glossary translated document).
Callers should expect no partial outputs. If there is any error during
document translation, no output will be stored in the Cloud Storage
bucket.
Optional. Specifies the translated document's mime_type.
If not specified, the translated file's mime type will be the same as the
input file's mime type.
Currently only support the output mime type to be the same as input mime
type.
Optional. Specifies the translated document's mime_type.
If not specified, the translated file's mime type will be the same as the
input file's mime type.
Currently only support the output mime type to be the same as input mime
type.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud Translation V3 Client - Class DocumentOutputConfig (2.0.3)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.3 (latest)](/php/docs/reference/cloud-translate/latest/V3.DocumentOutputConfig)\n- [2.0.2](/php/docs/reference/cloud-translate/2.0.2/V3.DocumentOutputConfig)\n- [1.21.0](/php/docs/reference/cloud-translate/1.21.0/V3.DocumentOutputConfig)\n- [1.20.2](/php/docs/reference/cloud-translate/1.20.2/V3.DocumentOutputConfig)\n- [1.19.0](/php/docs/reference/cloud-translate/1.19.0/V3.DocumentOutputConfig)\n- [1.18.1](/php/docs/reference/cloud-translate/1.18.1/V3.DocumentOutputConfig)\n- [1.17.7](/php/docs/reference/cloud-translate/1.17.7/V3.DocumentOutputConfig)\n- [1.16.0](/php/docs/reference/cloud-translate/1.16.0/V3.DocumentOutputConfig)\n- [1.15.4](/php/docs/reference/cloud-translate/1.15.4/V3.DocumentOutputConfig)\n- [1.14.3](/php/docs/reference/cloud-translate/1.14.3/V3.DocumentOutputConfig)\n- [1.13.3](/php/docs/reference/cloud-translate/1.13.3/V3.DocumentOutputConfig)\n- [1.12.12](/php/docs/reference/cloud-translate/1.12.12/V3.DocumentOutputConfig) \nReference documentation and code samples for the Cloud Translation V3 Client class DocumentOutputConfig.\n\nA document translation request output config.\n\nGenerated from protobuf message `google.cloud.translation.v3.DocumentOutputConfig`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Translate \\\\ V3\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getGcsDestination\n\nOptional. Google Cloud Storage destination for the translation output,\ne.g., `gs://my_bucket/my_directory/`.\n\nThe destination directory provided does not have to be empty, but the\nbucket must exist. If a file with the same name as the output file\nalready exists in the destination an error will be returned.\nFor a DocumentInputConfig.contents provided document, the output file\nwill have the name \"output_\\[trg\\]_translations.\\[ext\\]\", where\n\n- \\[trg\\] corresponds to the translated file's language code,\n- \\[ext\\] corresponds to the translated file's extension according to its mime type. For a DocumentInputConfig.gcs_uri provided document, the output file will have a name according to its URI. For example: an input file with URI: `gs://a/b/c.[extension]` stored in a gcs_destination bucket with name \"my_bucket\" will have an output URI: `gs://my_bucket/a_b_c_[trg]_translations.[ext]`, where\n- \\[trg\\] corresponds to the translated file's language code,\n- \\[ext\\] corresponds to the translated file's extension according to its mime type. If the document was directly provided through the request, then the output document will have the format: `gs://my_bucket/translated_document_[trg]_translations.[ext]`, where\n- \\[trg\\] corresponds to the translated file's language code,\n- \\[ext\\] corresponds to the translated file's extension according to its mime type. If a glossary was provided, then the output URI for the glossary translation will be equal to the default output URI but have `glossary_translations` instead of `translations`. For the previous example, its glossary URI would be: `gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]`. Thus the max number of output files will be 2 (Translated document, Glossary translated document). Callers should expect no partial outputs. If there is any error during document translation, no output will be stored in the Cloud Storage bucket.\n\n### hasGcsDestination\n\n### setGcsDestination\n\nOptional. Google Cloud Storage destination for the translation output,\ne.g., `gs://my_bucket/my_directory/`.\n\nThe destination directory provided does not have to be empty, but the\nbucket must exist. If a file with the same name as the output file\nalready exists in the destination an error will be returned.\nFor a DocumentInputConfig.contents provided document, the output file\nwill have the name \"output_\\[trg\\]_translations.\\[ext\\]\", where\n\n- \\[trg\\] corresponds to the translated file's language code,\n- \\[ext\\] corresponds to the translated file's extension according to its mime type. For a DocumentInputConfig.gcs_uri provided document, the output file will have a name according to its URI. For example: an input file with URI: `gs://a/b/c.[extension]` stored in a gcs_destination bucket with name \"my_bucket\" will have an output URI: `gs://my_bucket/a_b_c_[trg]_translations.[ext]`, where\n- \\[trg\\] corresponds to the translated file's language code,\n- \\[ext\\] corresponds to the translated file's extension according to its mime type. If the document was directly provided through the request, then the output document will have the format: `gs://my_bucket/translated_document_[trg]_translations.[ext]`, where\n- \\[trg\\] corresponds to the translated file's language code,\n- \\[ext\\] corresponds to the translated file's extension according to its mime type. If a glossary was provided, then the output URI for the glossary translation will be equal to the default output URI but have `glossary_translations` instead of `translations`. For the previous example, its glossary URI would be: `gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]`. Thus the max number of output files will be 2 (Translated document, Glossary translated document). Callers should expect no partial outputs. If there is any error during document translation, no output will be stored in the Cloud Storage bucket.\n\n### getMimeType\n\nOptional. Specifies the translated document's mime_type.\n\nIf not specified, the translated file's mime type will be the same as the\ninput file's mime type.\nCurrently only support the output mime type to be the same as input mime\ntype.\n\n- application/pdf\n- application/vnd.openxmlformats-officedocument.wordprocessingml.document\n- application/vnd.openxmlformats-officedocument.presentationml.presentation\n- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\n\n### setMimeType\n\nOptional. Specifies the translated document's mime_type.\n\nIf not specified, the translated file's mime type will be the same as the\ninput file's mime type.\nCurrently only support the output mime type to be the same as input mime\ntype.\n\n- application/pdf\n- application/vnd.openxmlformats-officedocument.wordprocessingml.document\n- application/vnd.openxmlformats-officedocument.presentationml.presentation\n- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\n\n### getDestination"]]