Reference documentation and code samples for the Cloud Translation V3 Client class InputConfig.
Input configuration for BatchTranslateText request.
Generated from protobuf message google.cloud.translation.v3.InputConfig
Namespace
Google \ Cloud \ Translate \ V3
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ mime_type
string
Optional. Can be "text/plain" or "text/html". For .tsv, "text/html" is used if mime_type is missing. For .html, this field must be "text/html" or empty. For .txt, this field must be "text/plain" or empty.
Required. Google Cloud Storage location for the source input. This can be a single file (for example, gs://translation-test/input.tsv) or a wildcard (for example, gs://translation-test/*). If a file extension is .tsv, it can contain either one or two columns. The first column (optional) is the id of the text request. If the first column is missing, we use the row number (0-based) from the input file as the ID in the output file. The second column is the actual text to be translated. We recommend each row be <= 10K Unicode codepoints, otherwise an error might be returned. Note that the input tsv must be RFC 4180 compliant. You could use https://github.com/Clever/csvlint to check potential formatting errors in your tsv file. csvlint --delimiter='\t' your_input_file.tsv The other supported file extensions are .txt or .html, which is treated as a single large chunk of text.
getMimeType
Optional. Can be "text/plain" or "text/html".
For .tsv, "text/html" is used if mime_type is missing.
For .html, this field must be "text/html" or empty.
For .txt, this field must be "text/plain" or empty.
Returns
Type
Description
string
setMimeType
Optional. Can be "text/plain" or "text/html".
For .tsv, "text/html" is used if mime_type is missing.
For .html, this field must be "text/html" or empty.
For .txt, this field must be "text/plain" or empty.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getGcsSource
Required. Google Cloud Storage location for the source input.
This can be a single file (for example,
gs://translation-test/input.tsv) or a wildcard (for example,
gs://translation-test/*). If a file extension is .tsv, it can
contain either one or two columns. The first column (optional) is the id
of the text request. If the first column is missing, we use the row
number (0-based) from the input file as the ID in the output file. The
second column is the actual text to be
translated. We recommend each row be <= 10K Unicode codepoints,
otherwise an error might be returned.
Note that the input tsv must be RFC 4180 compliant.
You could use https://github.com/Clever/csvlint to check potential
formatting errors in your tsv file.
csvlint --delimiter='\t' your_input_file.tsv
The other supported file extensions are .txt or .html, which is
treated as a single large chunk of text.
Required. Google Cloud Storage location for the source input.
This can be a single file (for example,
gs://translation-test/input.tsv) or a wildcard (for example,
gs://translation-test/*). If a file extension is .tsv, it can
contain either one or two columns. The first column (optional) is the id
of the text request. If the first column is missing, we use the row
number (0-based) from the input file as the ID in the output file. The
second column is the actual text to be
translated. We recommend each row be <= 10K Unicode codepoints,
otherwise an error might be returned.
Note that the input tsv must be RFC 4180 compliant.
You could use https://github.com/Clever/csvlint to check potential
formatting errors in your tsv file.
csvlint --delimiter='\t' your_input_file.tsv
The other supported file extensions are .txt or .html, which is
treated as a single large chunk of text.
[[["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-09 UTC."],[],[],null,["# Cloud Translation V3 Client - Class InputConfig (2.0.3)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.3 (latest)](/php/docs/reference/cloud-translate/latest/V3.InputConfig)\n- [2.0.2](/php/docs/reference/cloud-translate/2.0.2/V3.InputConfig)\n- [1.21.0](/php/docs/reference/cloud-translate/1.21.0/V3.InputConfig)\n- [1.20.2](/php/docs/reference/cloud-translate/1.20.2/V3.InputConfig)\n- [1.19.0](/php/docs/reference/cloud-translate/1.19.0/V3.InputConfig)\n- [1.18.1](/php/docs/reference/cloud-translate/1.18.1/V3.InputConfig)\n- [1.17.7](/php/docs/reference/cloud-translate/1.17.7/V3.InputConfig)\n- [1.16.0](/php/docs/reference/cloud-translate/1.16.0/V3.InputConfig)\n- [1.15.4](/php/docs/reference/cloud-translate/1.15.4/V3.InputConfig)\n- [1.14.3](/php/docs/reference/cloud-translate/1.14.3/V3.InputConfig)\n- [1.13.3](/php/docs/reference/cloud-translate/1.13.3/V3.InputConfig)\n- [1.12.12](/php/docs/reference/cloud-translate/1.12.12/V3.InputConfig) \nReference documentation and code samples for the Cloud Translation V3 Client class InputConfig.\n\nInput configuration for BatchTranslateText request.\n\nGenerated from protobuf message `google.cloud.translation.v3.InputConfig`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Translate \\\\ V3\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getMimeType\n\nOptional. Can be \"text/plain\" or \"text/html\".\n\nFor `.tsv`, \"text/html\" is used if mime_type is missing.\nFor `.html`, this field must be \"text/html\" or empty.\nFor `.txt`, this field must be \"text/plain\" or empty.\n\n### setMimeType\n\nOptional. Can be \"text/plain\" or \"text/html\".\n\nFor `.tsv`, \"text/html\" is used if mime_type is missing.\nFor `.html`, this field must be \"text/html\" or empty.\nFor `.txt`, this field must be \"text/plain\" or empty.\n\n### getGcsSource\n\nRequired. Google Cloud Storage location for the source input.\n\nThis can be a single file (for example,\n`gs://translation-test/input.tsv`) or a wildcard (for example,\n`gs://translation-test/*`). If a file extension is `.tsv`, it can\ncontain either one or two columns. The first column (optional) is the id\nof the text request. If the first column is missing, we use the row\nnumber (0-based) from the input file as the ID in the output file. The\nsecond column is the actual text to be\ntranslated. We recommend each row be \\\u003c= 10K Unicode codepoints,\notherwise an error might be returned.\nNote that the input tsv must be RFC 4180 compliant.\nYou could use \u003chttps://github.com/Clever/csvlint\u003e to check potential\nformatting errors in your tsv file.\ncsvlint --delimiter='\\\\t' your_input_file.tsv\nThe other supported file extensions are `.txt` or `.html`, which is\ntreated as a single large chunk of text.\n\n### hasGcsSource\n\n### setGcsSource\n\nRequired. Google Cloud Storage location for the source input.\n\nThis can be a single file (for example,\n`gs://translation-test/input.tsv`) or a wildcard (for example,\n`gs://translation-test/*`). If a file extension is `.tsv`, it can\ncontain either one or two columns. The first column (optional) is the id\nof the text request. If the first column is missing, we use the row\nnumber (0-based) from the input file as the ID in the output file. The\nsecond column is the actual text to be\ntranslated. We recommend each row be \\\u003c= 10K Unicode codepoints,\notherwise an error might be returned.\nNote that the input tsv must be RFC 4180 compliant.\nYou could use \u003chttps://github.com/Clever/csvlint\u003e to check potential\nformatting errors in your tsv file.\ncsvlint --delimiter='\\\\t' your_input_file.tsv\nThe other supported file extensions are `.txt` or `.html`, which is\ntreated as a single large chunk of text.\n\n### getSource"]]