Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/translation/azure-ai-translation-document/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
[custom_model]: https://docs.microsoft.com/azure/cognitive-services/translator/custom-translator/quickstart-build-deploy-custom-model
[glossary]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/overview#supported-glossary-formats
[sas_token]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/create-sas-tokens?tabs=Containers#create-your-sas-tokens-with-azure-storage-explorer
[sas_token_permissions]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/get-started-with-document-translation?tabs=csharp#create-sas-access-tokens-for-document-translation
[sas_token_permissions]: https://aka.ms/azsdk/documenttranslation/sas-permissions
[azure_storage_blob]: https://pypi.org/project/azure-storage-blob/

[azure_core_ref_docs]: https://aka.ms/azsdk/python/core/docs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ def begin_translation(
https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/overview

:param str source_url: The source SAS URL to the Azure Blob container containing the documents
to be translated. Requires read and list permissions at the minimum.
to be translated. See the service documentation for the supported SAS permissions for accessing
source storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions
:param str target_url: The target SAS URL to the Azure Blob container where the translated documents
should be written. Requires write and list permissions at the minimum.
should be written. See the service documentation for the supported SAS permissions for accessing
target storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions
:param str target_language_code: This is the language you want your documents to be translated to.
See supported language codes here:
https://docs.microsoft.com/azure/cognitive-services/translator/language-support#translate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class TranslationGlossary(object): # pylint: disable=useless-object-inheritance

:param str glossary_url: Required. Location of the glossary file. This should be a SAS URL to
the glossary file in the storage blob container. If the translation language pair is
not present in the glossary, it will not be applied.
not present in the glossary, it will not be applied. See the service documentation for the
supported SAS permissions: https://aka.ms/azsdk/documenttranslation/sas-permissions
:param str file_format: Required. Format of the glossary file. To see supported formats,
call the :func:`~DocumentTranslationClient.get_supported_glossary_formats()` client method.
:keyword str format_version: File format version. If not specified, the service will
Expand All @@ -31,7 +32,8 @@ class TranslationGlossary(object): # pylint: disable=useless-object-inheritance

:ivar str glossary_url: Required. Location of the glossary file. This should be a SAS URL to
the glossary file in the storage blob container. If the translation language pair is
not present in the glossary, it will not be applied.
not present in the glossary, it will not be applied. See the service documentation for the
supported SAS permissions: https://aka.ms/azsdk/documenttranslation/sas-permissions
:ivar str file_format: Required. Format of the glossary file. To see supported formats,
call the :func:`~DocumentTranslationClient.get_supported_glossary_formats()` client method.
:ivar str format_version: File format version. If not specified, the service will
Expand Down Expand Up @@ -79,7 +81,9 @@ class TranslationTarget(object): # pylint: disable=useless-object-inheritance
"""Destination for the finished translated documents.

:param str target_url: Required. The target location for your translated documents.
This should be a container SAS URL to your target container.
This should be a container SAS URL to your target container/blob. See the service
documentation for the supported SAS permissions for accessing
target storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions
:param str language_code: Required. Target Language Code. This is the language
you want your documents to be translated to. See supported languages here:
https://docs.microsoft.com/azure/cognitive-services/translator/language-support#translate
Expand All @@ -90,7 +94,9 @@ class TranslationTarget(object): # pylint: disable=useless-object-inheritance
Currently only "AzureBlob" is supported.

:ivar str target_url: Required. The target location for your translated documents.
This should be a container SAS URL to your target container.
This should be a container SAS URL to your target container/blob. See the service
documentation for the supported SAS permissions for accessing
target storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions
:ivar str language_code: Required. Target Language Code. This is the language
you want your documents to be translated to. See supported languages here:
https://docs.microsoft.com/azure/cognitive-services/translator/language-support#translate
Expand Down Expand Up @@ -150,7 +156,8 @@ class DocumentTranslationInput(object): # pylint: disable=useless-object-inheri
translated and written to the location provided by the TranslationTargets.

:param str source_url: Required. Location of the folder / container or single file with your
documents.
documents. See the service documentation for the supported SAS permissions for accessing
source storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions
:param targets: 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.
:type targets: list[~azure.ai.translation.document.TranslationTarget]
Expand All @@ -168,7 +175,8 @@ class DocumentTranslationInput(object): # pylint: disable=useless-object-inheri
Currently only "AzureBlob" is supported.

:ivar str source_url: Required. Location of the folder / container or single file with your
documents.
documents. See the service documentation for the supported SAS permissions for accessing
source storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions
:ivar targets: 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.
:vartype targets: list[~azure.ai.translation.document.TranslationTarget]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@ async def begin_translation(
https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/overview

:param str source_url: The source SAS URL to the Azure Blob container containing the documents
to be translated. Requires read and list permissions at the minimum.
to be translated. See the service documentation for the supported SAS permissions for accessing
source storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions
:param str target_url: The target SAS URL to the Azure Blob container where the translated documents
should be written. Requires write and list permissions at the minimum.
should be written. See the service documentation for the supported SAS permissions for accessing
target storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions
:param str target_language_code: This is the language you want your documents to be translated to.
See supported language codes here:
https://docs.microsoft.com/azure/cognitive-services/translator/language-support#translate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def create_target_container(self, data=None):
if data:
self.upload_documents(data, container_client)

return self.generate_sas_url(self.target_container_name, "rw")
return self.generate_sas_url(self.target_container_name, "wl")

def generate_sas_url(self, container_name, permission):

Expand Down