Both Binary runtime files and the source code file can be downloaded at:
The idea came when I found out that Google is shutting down it’s Translation API:
There is no real answer from Google to why it’s “Deprecating” it’s Translation API, but anyway, looks like Google is in love with it’s deprecation policy. I believe developer community is loosing faith in Google. An example is a comment by Vienna consultant Franz Enzenholder: “why should any developer, any company which wants to build a valuable product for the long term use any of your APIs ever again?”
Anyway, Bing offering a similar free Translation APIs, and it’s supporting the following scenarios/protocols:
- HTTP Service: A RESTFUL version of the APIs.
- SOAP Service: A classic SOAP protocol version of the APIs.
Bing Translations Extensions Design:
For consuming any Web Service either it’s based on SOAP,REST or Open Data protocol, the following steps are always required in order to make the consumption done properly:
Generate an application ID for consuming the web services from the provider (Bing App ID, Google API Key, Facebook API key, etc..)
Adding the Web Service API URL as a reference to your project.
When working on server side apps, the IDE will generate a proxy client for the services that makes the web methods more language neutral.
Application (API) ID must be provided on each web service call.
Well, the main goal of this project is to provide an easier developer experience on consuming Bing Translator APIs by providing the following:
Reducing the parameters number by providing the Bing Application ID just for one time during the development.
Providing more language integrated methods that cut the efforts and learning curve of using the APIs through .NET Extension Methods feature.
These objectives are achieved by depending on the .NET Extension Methods feature while designing the Bing Translator APIs Wrapper.
How to use this library:
The following steps contains the necessary steps to enable the extension methods in your project:
2- Download the Bing Translator .NET Extension Methods Runtime Files from http://bit.ly/mY6Bze.
3- Extract the Zip file and you will find the following files:
app.config: Contains all the configuration of the Bing Translator SOAP EndPoint.
DevoPoint.Framework.Extensions.BingTranslator.dll: Library Runtime File.
DevoPoint.Framework.Extensions.BingTranslator.dll.config: Contains all the configuration of the Bing Translator SOAP EndPoint.
*Please note that you must always includes the app.config file in your project files, otherwise you will run into an error when the .NET CRL tries to locate the Bing Translator Service end point.*
4- Use the namespace of the project: When starting a new project, you should add the following line of code to make the extension methods available at your project code:
Now the Bing Translator .NET Extension Methods are enabled in your project.
5- Set the Bing App ID for one time in a property:
To avoid using the Bing App ID on each Web Method call, Just set the property BingAppID for one time and you are dong, you don’t need to set it again at anytime, here below an example:
BingTranslationExtension.BingAppID = “YOURBINGAPPID”;
Project Methods and Features:
Below is a list of the features and .NET Extension Methods that a developer can utilize during development:
* Strong Typed Bing Translator Supported languages through Enum: With Enum, developer does not have to worry again about writing the culture codes, it’s already available through the Visual Studio IDE intellisense as the following:
* Translate method available for all strings: With BingTranslate Extension Method, developer can translate from and to any language easily in one line as the following:
There are two methods for translation, the first one will auto-detect the language and translate the text into the destination language, while in using the second method, developer must provide the source language as the following:
* Language Detect Extension Method: The library will extend strings with the method DetectLanguage, which returns the language of the current text as the following:
* Language Speaking Wave File Extension Method: The library will also provide the developer with a method which returns a URL of the wave file contains the speaking audio of the text, as the following:
* Language Speaking Support Extension Method: Bing Translator is not supporting the speaking feature for all languages yet, The extension method IsSpeakingSupported will indicate if the language speaking feature supported or not, as the following:
GetSpeakingSupportedLanguages extension method returns a list of the speaking supported languages names in specific language as the following:
As you can see in the figure above, there are also other two extension methods:
The first method returns the translation of the language name in a specific language which the developer determines by the parameters, the second method will return a list of languages translated to the extended BingLanguage value, in this case It will return all languages names in Arabic.
In the future versions I am going to support the following features incremently:
Supporting HTTP (REST) APIs instead of SOAP.
Supporting the Array Methods.
Building a WPF/WP7 Bing-Translator Enabled Controls.
Building a JQuery Plugins for Bing Translator.