Recently I was contacted via https://aka.ms/matvoice by a developer using MAT with a question. “Why are the results from the Microsoft Translator Provider in MAT different than those from http://www.bing.com/translator? Well, that is a great question. Let me answer the question by showing some of the configuration options available for that provider.
The quick answer:
The release of MAT v3.0 added support for Microsoft Translator’s Hub (See: http://blogs.msdn.com/b/matdev/archive/2014/04/14/announcing-multilingual-app-toolkit-v3-0.aspx for specifics). MAT uses the ‘Tech’ category by default as this is geared more towards software terms. The Translator website uses the ‘General’ category when processing the requests. The good news is that this is configurable if the Tech category does not fit your needs.
Here is how to configure MAT to match that of the Translator website.
- Open Notepad as Administrator
- Open MAT’s Microsoft Translator configuration file . It is located at "C:\ProgramData\Multilingual App Toolkit\MicrosoftTranslatorProvider\TranslatorSettings.xml"
- Change "<Category>Tech</Category>" to "<Category>General</Category>"
- Save the file
Please adjust the above path If your %ProgramData% environment is different.
Be sure to restart the Editor (or VS) to use the updated configuration.
Since we are here, let’s discuss some of the other options as well…
Here is a snippet of the file:
As indicated above, the <Category> element is used to add Microsoft Translator’s Hub functionality into MAT’s translation services. However, this is not limited to the General and Tech categories. If you have a custom Hub (or your friend does), you can set the <Category> value to their Hub and take advantage of their customized translations directly within MAT.
Looking at the configuration file, you probably noticed the <Protocol> element. The Microsoft Translator APIs allow for translation requests using HTTPS. By default, this is set to HTTP – as indicated by the <Protocol> value. Changing this to HTTPS will access the Microsoft Translator Service over the SSL protocol.
When you look at the <language> elements, you might be asking yourself “Why we define all the region languages separately”? The answer is that the Microsoft Translator service uses a language neutral approach to generating translations. An example is French France which is slightly different than French Canadian, but most of the words or phrases are common between both. As such, to enable the supported languages and indicators, we map the Microsoft Translator neutral languages (FR) to the language specific codes (fr-FR, fr-CA, etc.) This allows us (and you) to fine tune the support to ensure the alignment is as you desire.
As you can tell, the configuration file is pretty straightforward. I hope this helps you understand some of the options that you have when using MAT and the Microsoft Translator Provider.