Automate, Accelerate, Accurate

Main menu

Category Archives: bing

When you come from another country, it can be difficult living in the Netherlands sometimes. Dutch is not as difficult as you’ll hear from others, but sometimes you want to make sure the sentence you’ve read means what you think. Mistakes can be embarrassing, expensive, or something that falls into the general I-should-have-checked-that-first category. Trust me, I know……..

Normally for translation I’ll use the Google Translate web site. The translation is not always 100% accurate, but usually enough to understand things. And it’s quick.

For automation, Google provide a web services API, but this is a paid-for service. Fortunately, Microsoft provide a free translation web service, not costing you anything unless you plan to translate more than 1,000,000 characters a month.

There are some steps that we need to do to be able to use Microsoft’s translation web service before we can begin scripting.

Sign up for the Microsoft Translator Web Service

3. Sign-in with your Microsoft account credentials (create a Microsoft account if you do not have one before continuing).

4. Begin to type Microsoft Translator into the search box at the top right.5. In the search list, click Microsoft Translator.

6. Click Sign Up on the free option.

7. Select the I have read and agree to the above publisher’s Offer Terms and Privacy Policy check box.
8. Click Sign Up.

Register your Application

Now it’s time to register our application which will be use the Microsoft Translator web service.

1. In the Client ID box, type a name that you wish you be associated with your application. This can be a mixture of numbers, letters, hyphens and underscores.2. In the Name box, type a suitable name for your application. This property is not used in the cmdlet we will be writing.3. In the Client secret box, type a password for the application. Keep this information secure.4. In the Redirect URI box, type any valid URL. This property is also not used in our script.5. In the Description box, type a description if you wish for later reference.6. Click CREATE

7. Select Sign Out. 8. Close your browser window.

Script the Cmdlet

With the previous steps complete, we can start to script the cmdlet. This cmdlet borrows code from MSDN, so I’d recommend visiting the Microsoft Translator pages for more information on the web service and examples.

The cmdlet uses input parameters of Text for the string to be converted, and From and To ones, which you use to indicate the original language the string is in, and the one you want it translated to. You can find the most recent list of supported languages at the Translator Language Codes webpage, also on MSDN.

I’ve enclosed an example below, together with the type of result you should expect.