08.11.2013, 15:11 | #1 |
Участник
|
palleagermark: Translate text with Microsoft Translator from AX
Источник: http://www.agermark.com/2013/11/tran...microsoft.html
============== I recently had a task involving the translation of a few thousand labels. To speed up the translation I figured that I would get a head start if I could somehow automate parts of the process. I found bits and pieces with which I could use the Bing or Microsoft Translator API for the task, and here is how to implement these in AX. First of all, you need to sign up for the service. You do that from the data market on Windows Azure. You can translate up to 2000000 characters a month for free. Here is a link to sign up for the service: https://datamarket.azure.com/developer/applications/ The bits and pieces I could find for calling the service is .NET code, so I have implemented this part as a C# Project. Here's the code for that part: http://sdrv.ms/HAOzcW With the C# Project in place, you can now do translation using this simple code: // Sign up: https://datamarket.azure.com/developer/applications/ // Translator language codes: http://msdn.microsoft.com/en-us/library/hh456380.aspx static void EGTranslateSample(Args _args) { EGBingTranslation.Translator translator; System.String clientId = "YourClientId"; System.String clientSecret = "XYZ123"; str translatedTxt; try { translator = new EGBingTranslation.Translator(); // Create an access token translator.CreateToken(clientId, clientSecret); // Translate translatedTxt = translator.Translate("Hvedeøl smager godt", "da", "en"); } catch (Exception::CLRError) { error(AifUtil::getClrErrorMessage()); } info (translatedTxt); } You get your Client Id and Client Secret when you sign up for the service on Azure. Please note that the Microsoft translation cannot stand alone, unless you think you users are in need of some cheap laughs. You have to have a human to review the translations. It seems that when you translate between two languages of which neither is English, that the translation is done using English as a "middleman". So for example a Danish to German translation is done first from Danish to English and then from English to German. In that process a lot of context can be lost and the result will not always be correct. Источник: http://www.agermark.com/2013/11/tran...microsoft.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|