Note: This module is a work in progress!
PSTranslate is a PowerShell module for translating text between languages.
It utilizes Microsoft Azure's Translator Text API.
Note: At the moment, this module requires one to have a Microsoft Azure account. Other translation services/methods may be added in the future.
- If you do not already have a Microsoft Azure account, create a free account here.
- Sign in to your Microsoft Azure portal.
- Click
+ Create a resource
, at the top of the navigation menu docked to the left side of the page. - In the
Search the Marketplace
search box, typeTranslator Text
, and then select it from the results. - Click the
Create
button, at the bottom-right of the page. - Enter the requested information and select your desired options in the
Create
form.
If this is your first time using Microsoft Azure, enter/select the following:- Name: Any name; I used
TranslatorTextAPI
- Subscription: Free Trial
- Pricing tier: F0
- Resource group: Create new, any name; I used
Default
- Resource group location: Central US
- Name: Any name; I used
- Click the
Create
button, at the bottom of the form. - After the Translator Text resource has finished initializing, select it from the resource list on your dashboard.
- In the resource navigation menu, under
Resource Management
, selectKeys
. - Copy
KEY 1
. - Create the file
Credentials.ps1
inPSTranslate\src
. - Add the following PowerShell command to the
Credentials.ps1
file:Set-Variable PSAzureTranslateApiKey 'YOUR_KEY_1' -Scope Global
Retrieves a list of all the languages to/from which text can be translated.
Get-LanguageList
Attempts to determine the language of a specified string.
Get-Language 'Parlez-vous francais?'
Translates a specified string.
Get-Translation 'Parlez-vous francais?'
Get-Translation 'Do you speak French?' -To 'fr'