DocumentTranslationInput Class
Input for translation. This requires that you have your source document or documents in an Azure Blob Storage container. Provide a URL to the source file or source container containing the documents for translation. The source document(s) are translated and written to the location provided by the TranslationTargets.
Constructor
DocumentTranslationInput(source_url: str, targets: List[TranslationTarget], *, source_language: str | None = None, storage_type: str | StorageInputType | None = None, storage_source: str | None = None, prefix: str | None = None, suffix: str | None = None)
Parameters
| Name | Description |
|---|---|
|
source_url
Required
|
Required. Location of the folder / container or single file with your documents. This can be a SAS URL (see the service documentation for the supported SAS permissions for accessing source storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions) or a managed identity can be created and used to access documents in your storage account (see https://aka.ms/azsdk/documenttranslation/managed-identity). |
|
targets
Required
|
Required. Location of the destination for the output. This is a list of TranslationTargets. Note that a TranslationTarget is required for each language code specified. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
source_language
|
Language code for the source documents. If none is specified, the source language will be auto-detected for each document. Default value: None
|
|
prefix
|
A case-sensitive prefix string to filter documents in the source path for translation. For example, when using a Azure storage blob Uri, use the prefix to restrict sub folders for translation. Default value: None
|
|
suffix
|
A case-sensitive suffix string to filter documents in the source path for translation. This is most often use for file extensions. Default value: None
|
|
storage_type
|
Storage type of the input documents source string. Possible values include: "Folder", "File". Default value: None
|
|
storage_source
|
Storage Source. Default value: "AzureBlob". Currently only "AzureBlob" is supported. Default value: None
|
Attributes
prefix
A case-sensitive prefix string to filter documents in the source path for translation. For example, when using a Azure storage blob Uri, use the prefix to restrict sub folders for translation.
prefix: str | None = None
source_language
Language code for the source documents. If none is specified, the source language will be auto-detected for each document.
source_language: str | None = None
source_url
Location of the folder / container or single file with your documents. This can be a SAS URL (see the service documentation for the supported SAS permissions for accessing source storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions) or a managed identity can be created and used to access documents in your storage account (see https://aka.ms/azsdk/documenttranslation/managed-identity).
source_url: str
storage_source
"AzureBlob". Currently only "AzureBlob" is supported.
storage_source: str | None = None
storage_type
Storage type of the input documents source string. Possible values include: "Folder", "File".
storage_type: str | StorageInputType | None = None
suffix
A case-sensitive suffix string to filter documents in the source path for translation. This is most often use for file extensions.
suffix: str | None = None
targets
Location of the destination for the output. This is a list of TranslationTargets. Note that a TranslationTarget is required for each language code specified.
targets: List[TranslationTarget]