Source language: Translate to:

Web - response from the browser

Questions and information about creating Internet aware NeoBook applications. Including PHP, HTML, FTP, HTTP, Email, etc.

Moderator: Neosoft Support

Web - response from the browser

Postby Leos » Wed Dec 04, 2013 11:10 am

Hi,

With this simple code, I say to google's translator to translate the phrase "Olá meus amigos do Neobook".
Is there any method for automatically translating and passing it to NeoBook?

I appreciate your help

Code: Select all

setvar "[termo]" "Olá meus amigos do Neobook"
SetVar "[languagesin]" "pt|en"

SetVar "[nettradutor]" "http://translate.google.pt/?hl=pt-PT&tab=nT#[languagesIn]|[termo]"

RefreshObject "WebBrowser1tradutor"
BrowserGoTo "WebBrowser1tradutor" "![nettradutor]"



........................................................
Com este simples código, digo ao google translator para me traduzir a frase "Olá meus amigos do Neobook!".
Existe algum método para obter automáticamente a tradução e passá-la para o neobook?
Agradeço a vossa ajuda
User avatar
Leos
 
Posts: 178
Joined: Mon Apr 04, 2005 11:13 am
Location: Coimbra, Portugal

Re: Web - response from the browser

Postby Gaev » Wed Dec 04, 2013 11:45 am

Leos:

You need to call their API service (using InternetGet) for what you want to do ... but it is not free ($20 per 1 million characters) ... reasonably priced, but if are going to include this inside NeoBook Applications that you distribute to users, be careful that they do not (somehow) reverse engineer your code and find out your API Key ... you will be charged for all requests made with the API Key assigned to you.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Web - response from the browser

Postby Neosoft Support » Wed Dec 04, 2013 11:48 am

If it was a normal web form you could use JavaScript to retrieve the translated text. However, it looks like Google has written their translation page in such a way that prevents this.

You might be able to use Bing's translation service via JavaScript through the browser:

http://web.archive.org/web/20110720142541/http://basharkokash.com/post/2010/04/19/Bing-Translator-for-developers.aspx
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Web - response from the browser

Postby mishem » Wed Dec 04, 2013 6:49 pm

Code: Select all
InternetPost "http://translate.google.com/translate_t?hl=en&ie=UTF8" "hl=en&ie=UTF8&oe=UTF8&text=[Text]&langpair=auto|ru" "[Text]" ""
zmConvertString "Utf8ToAnsi" "[Text]" "[Text]"

SearchStr "TRANSLATED_TEXT" "[Text]" "[Result]" ""
SearchStr "INPUT_TOOL_PATH" "[Text]" "[Result2]" ""

SubStr "[Text]" "[Result]+17" "[Result2]-[Result]-19" "[Text]"


zmConvertString - plug-in zmFunctions
langpair=auto|ru
Will still need to replace special characters html
mishem
 
Posts: 574
Joined: Mon Oct 08, 2012 1:51 pm

Re: Web - response from the browser

Postby smokinbanger » Sat Dec 07, 2013 7:37 pm

I spent some time on this too and after digging into there source code found they intentionally left out the Element Name from the result_box apparently for this very reason; to force users to purchase the translations via the api billing.
Just Sayin'...
smokinbanger
 
Posts: 198
Joined: Mon Jan 16, 2012 9:53 am
Location: United States

Re: Web - response from the browser

Postby Leos » Wed Dec 11, 2013 10:01 am

Thanks to all who tried to help.
Unfortunately it seems to be a little complicated, unfortunately.
As an example, I present the link to one of the possible applications.

mishem, I could not test your code.
Once I have results, I communicate

Best regards

http://www.neosoftware.com/community/viewtopic.php?f=6&t=20298
User avatar
Leos
 
Posts: 178
Joined: Mon Apr 04, 2005 11:13 am
Location: Coimbra, Portugal


Return to NeoBook and the Internet

Who is online

Users browsing this forum: No registered users and 1 guest