AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 09.10.2009, 17:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
Arijit Basu: Dynamics AX, BING & Language Translation
Источник: http://daxguy.blogspot.com/2009/10/d...anslation.html
==============

I was doing some R & D on BING API (Search & Translate) and hit upon the idea of data translation in AX using BING Translate services. Presently when a user changes the AX Language, the Labels change but data does not. It would be nice if this data could also change based on the language change. To do a simple POC, I did some R&D as follows:
1. Create a .NET APP which would consume the BING Translate API to translate text. The simple UI is as follows and works great :-)

2. Replicate this feature inside AX to translate a text inside AX using the BING API and add it as a WS reference . The POC worked and it the simple UI I created is as follows:

3. Now inside AX, create a form and a tmp table and use the API to translate data on the form. I have created a simple UI with 2 Buttons for 2 languages (en) & (ar). When I press the (en) button, the data is displayed in English and when I press (ar) the data is shown in Arabic. I have used a simple Customer Table query for an example. The Screenshot shows the same form side by side with different data translated :)

Comparison...


This obviously is not related to day to day work but just an idea which hit me and I just wanted to explore whether it works. Definitely to achieve this in real life would require architectural changes. Something similar to the UTC DateTime features where the DateTIme is stored in UTC in DB and the AU UI changes based on User settings. ence this POC is just to explore data translation possibilities only. The POC has worked :) and I'm sharing this as is. For creating new data I id not consider, just view. Again this was for some good fun.
To use the BING Apps, you need to create an APP id. Some important reference URL's are:
BING Developer Centre:
http://www.bing.com/developers
Search WSDL for BING : http://api.bing.net/search.wsdl
Translation API for BING : http://api.microsofttranslator.com/V1/SOAP.svc
BING DEV App id: http://www.bing.com/developers/appids.aspx
Steps:
1. Add the WS (
http://api.microsofttranslator.com/V1/SOAP.svc) inside References Node:
2. Sample Code
Static Server Str TranslateData(Str _text = "")
{
Translation.LanguageServiceClient ls;
Str AppId = "Your BING APP ID";
Str FromL="en",ToL="ar",SourceText="";
Str Lang[];
Str Value="";
try
{
new InteropPermission(InteropKind::ClrInterop).assert();
ls = new Translation.LanguageServiceClient();
//ls.GetLanguages(AppId);
Value = ls.Translate(AppId,_text,FromL,ToL);
CodeAccessPermission::revertAssert();
}
catch(Exception::CLRError)
{
throw error(AifUtil::getClrErrorMessage());
}
Return Value;
}
This POC was created just for some serious fun :) . To be taken on the lighter side :)






Источник: http://daxguy.blogspot.com/2009/10/d...anslation.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Arijit Basu: AX 2009 Document Management & MOSS / WSS Blog bot DAX Blogs 0 23.01.2009 01:07
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
Arijit Basu: Microsoft Dynamics AX Technology Webcast Series Blog bot DAX Blogs 0 12.01.2008 12:31
Arijit Basu: Reporting & BI in AX: An Overview [Level 100] Blog bot DAX Blogs 0 07.01.2008 16:01
Dynamics AX: Microsoft Dynamics AX (DAX): Known Issues when upgrading to Microsoft Dynamics™ AX 4.0 - Arijit Basu | AX MVP Blog bot DAX Blogs 0 31.05.2007 03:30

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 13:19.