cancel
Showing results for 
Search instead for 
Did you mean: 

API google traduction

Former Member
0 Kudos

Hello,

Is it possible to use the Google Translate API in a Webdynpro Abap ?

If so, could you tell me the procedure to apply ?

Thanks for your help.

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I would say no. The google translate API is client side JavaScript based. Since you can't use custom JavaScript in Web Dynpro there would be no way to inject such functionality. The iFrame UI element or a separate iView in the portal with inner content running as a BSP perhaps would be the only solution. You would need the input/text field you want translated to be within this separate content as well.

Former Member
0 Kudos

This is the solution that I had started :

http://help.sap.com/saphelp_erp2005/helpdata/en/15/c07941601b1d09e10000000a155106/content.htm

You confirm the way to be taken. Thank you.

Do you have documentation regarding the integration of BSP by IFRAME?

Thanks for you help.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

No, I don't really have much more documentaiton on the iFrame than what you have already found. I would actually suggest going with the portal iView approach first. You can use portal eventing to communicate between WDA and BSP. With the iFrame you have communciation, session and authentication problems. Also iFrame was depreciated at one point and removed in later 7.0 Support Packages. In 7.02 it is un-depreciated and is returned - however if you move up to the SPs on 7.0 you could still have problems with the removal.

Former Member
0 Kudos

Is there another way to integrate or call a BSP application in a WDA ?

And the transition to call the api google translation in a BSP?

I tried a google javascript function : http://code.google.com/apis/ajax/playground/?exp=language#translate.

But without result. : ((

Edited by: KhalidTaibi on Jul 15, 2009 3:55 PM

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You should be able to pretty much cut and paste the JavaScript examples and get them working in BSP. Any standard HTML and JavaScript works within BSP. But that isn't really a discussion for this forum. If you are having problems with BSP, I suggest you take that question up in the BSP forum.

Former Member
0 Kudos

Hi,

I'm working with Khalid and we just try to use the Google AJAX Language API to translate some specific texts from our R/3 system; In fact, we prefer create a WDA application rather than a BSP but it's seems not to be possible to use google API in WDA. Do you have any suggestions ? Maybe there're others functions for translation in SAP world. We try Google one just because it's the first we found....

Pierre PRUVOST

PS: We're are very proud talking with you, Thomas , because, for us, through your blog, you're "un Maître" in WDA science.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I'm not sure what other translation services might be available. If you want them to work in WDA, then look for ones that can be called from the Server Backend - using REST or SOAP based web services. Likely you will find such services, but they probably charge a fee.

The other option would be to try and study the AJAX post back that the Google APIs make and replicate that in ABAP using the CL_HTTP_CLIENT class. However be careful, as that might be a violation of the Google APIs terms of service.

Former Member
0 Kudos

Hi,

It seems there is a REST interface for this API : http://code.google.com/apis/ajaxlanguage/documentation/#fonje

For Flash developers, and those developers that have a need to access the AJAX Language API from other Non-JavaScript environments, the API exposes a simple RESTful interface.

So as Thomas suggested, you can use the CL_HTTP_CLIENT class and call this REST Web Service.

Regards,

Pierre

Edited by: Pierre DOMINIQUE on Jul 21, 2009 5:34 PM

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Very nice that there is a REST based interface as well. This should work well from ABAP. However watch out as the translation string is passed as URL parameter and would therefore be limited by the specification of the HTTP URLs work.