Export (0) Print
Expand All

The Bing Translator Control

Bing

The Bing Translator Control enables your Windows Store App running on a Windows 8 or Windows RT machine to translate text from one natural language to another. The control takes the text you pass in to the Bing Translator web service for translation, and then passes the translation of the input back to you. Your application can handle the return text however you see fit.

Published date: October 21, 2013

Uses of Bing Translator

When you embed the Bing Translator Control in an application, you control how your application interprets the text returned by the Translator Service. The Translator Control itself exposes no UI in your app. It remains invisible, so that you can receive the input, as well as render, the translated text as it fits best in your application context. You can combine Translator with other services such as Bing OCR to translate a restaurant menu or street sign, or translate the query to or the response from the Bing Search API.

Bing Translator Basics

The Bing Translator Control is a XAML control that you can add to any Windows 8 XAML application. End users must have Windows 8, Windows 8.1, or Windows RT installed to view the control. The Translator Control has no default UI. You receive the text to translate by any means, and render it by any means you choose, and use the Translator Control in the middle, to translate the input text to the target language. The input to the control is the text to translate, an identifier of the language to translate from, and an identifier of the language to translate to.

Bing Translator Subscription Requirements

Bing Translator is part of the Windows Azure Marketplace. To gain access to the Translator Service, you need a subscription to Microsoft Translator at the Windows Azure Marketplace, and then create a client ID/client secret pair at https://datamarket.azure.com/developer/applications. The subscription is free for a consumption of up to 2 million characters per month.

When you are ready to publish your application, you can do so on the Marketplace.

Key API for Bing Translator

API Description

TranslatorControl Class

The class that represents the Translator XAML control.

TranslatorLibrary.TranslateAsync(string, string, string, string) Method

Translates a text string from one language to another. Return value is the translated string.

TranslatorLibrary.GetLanguagesAsync() Method

Returns an array of language IDs that the Translator control can translate from or to. The Translator control can translate any of the listed languages to any other listed language.

TranslatorControl.Completed Event

Raised by the TranslateAsync() Method when the Translator Control receives a response from the Bing Translator Service. The service response is stored in the TranslatorCompletedEventArgs object associated with this event.

TranslationResult Class

Contains the contents of the response returned by the Translator Service.

GetLanguagesResult Class

Contains an array of language IDs the Translator Control can translate from or to.

Examples

For an example implementation of the Translator Control in a C# XAML application, see TranslatorControl Class. For a JavaScript example, see the TranslatorLibrary Class documentation.

In this section

Additional resources

Show:
© 2014 Microsoft