-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Add CLI examples for translate-text and list-languages commands #9785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,62 @@ | ||||||
| **To list supported languages** | ||||||
|
|
||||||
| The following ``list-languages`` example lists all languages supported by Amazon Translate. :: | ||||||
|
|
||||||
| aws translate list-languages | ||||||
|
|
||||||
| Output:: | ||||||
|
|
||||||
| { | ||||||
| "Languages": [ | ||||||
| { | ||||||
| "LanguageName": "Afrikaans", | ||||||
| "LanguageCode": "af" | ||||||
| }, | ||||||
| { | ||||||
| "LanguageName": "Albanian", | ||||||
| "LanguageCode": "sq" | ||||||
| }, | ||||||
| { | ||||||
| "LanguageName": "Amharic", | ||||||
| "LanguageCode": "am" | ||||||
| }, | ||||||
| { | ||||||
| "LanguageName": "Arabic", | ||||||
| "LanguageCode": "ar" | ||||||
| }, | ||||||
| { | ||||||
| "LanguageName": "Armenian", | ||||||
| "LanguageCode": "hy" | ||||||
| }, | ||||||
| { | ||||||
| "LanguageName": "Azerbaijani", | ||||||
| "LanguageCode": "az" | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
|
|
||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please provide a "For more information" link for every example in this request. See format in the contribution guide: aws.github.io/aws-cli/docs_styleguide.html#for-more-information-link |
||||||
| **To list languages with a specific display language** | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| The following ``list-languages`` example lists supported languages with names displayed in German. :: | ||||||
|
|
||||||
| aws translate list-languages \ | ||||||
| --display-language-code de | ||||||
|
|
||||||
| Output:: | ||||||
|
|
||||||
| { | ||||||
| "Languages": [ | ||||||
| { | ||||||
| "LanguageName": "Afrikaans", | ||||||
| "LanguageCode": "af" | ||||||
| }, | ||||||
| { | ||||||
| "LanguageName": "Albanisch", | ||||||
| "LanguageCode": "sq" | ||||||
| }, | ||||||
| { | ||||||
| "LanguageName": "Amharisch", | ||||||
| "LanguageCode": "am" | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please provide a "For more information" link for every example in this request. See format in the contribution guide: aws.github.io/aws-cli/docs_styleguide.html#for-more-information-link |
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||
| **To translate text from one language to another** | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| The following ``translate-text`` example translates the text "Hello, world!" from English to Spanish. :: | ||||||
|
|
||||||
| aws translate translate-text \ | ||||||
| --source-language-code en \ | ||||||
| --target-language-code es \ | ||||||
| --text "Hello, world!" | ||||||
|
|
||||||
| Output:: | ||||||
|
|
||||||
| { | ||||||
| "TranslatedText": "¡Hola, mundo!", | ||||||
| "SourceLanguageCode": "en", | ||||||
| "TargetLanguageCode": "es" | ||||||
| } | ||||||
|
|
||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please provide a "For more information" link for every example in this request. See format in the contribution guide: aws.github.io/aws-cli/docs_styleguide.html#for-more-information-link |
||||||
| **To translate text with auto-detection of source language** | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| The following ``translate-text`` example translates text without specifying the source language, allowing Amazon Translate to automatically detect it. :: | ||||||
|
|
||||||
| aws translate translate-text \ | ||||||
| --source-language-code auto \ | ||||||
| --target-language-code fr \ | ||||||
| --text "Good morning" | ||||||
|
|
||||||
| Output:: | ||||||
|
|
||||||
| { | ||||||
| "TranslatedText": "Bonjour", | ||||||
| "SourceLanguageCode": "en", | ||||||
| "TargetLanguageCode": "fr" | ||||||
| } | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please provide a "For more information" link for every example in this request. See format in the contribution guide: aws.github.io/aws-cli/docs_styleguide.html#for-more-information-link |
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.