Hello Everyone,
Couple of days ago I found below code for google translation in excel spreadsheets. the reason was our users are restricted to surf on internet and I just want to grand access to one file so that they can use that spread sheet for short translations. The file works great, but only works for the Latin alphabet. I keep on getting “?” on English translation when I type Chinese. Below is the code for the file.</SPAN>
here is the formula goes to cell which translates into English
Where
C4:"Chinese text that I typed"
B4:zh-TW (Code for Traditional Chinese)
E3: en (code for English)
I am sure there is something with ASCII setting but could not able to get.
If you want to see the original excel file you can downloaded below link(excelforum link)
Excel Help Forum
Thank you very much for your kind attention.
Baha
Couple of days ago I found below code for google translation in excel spreadsheets. the reason was our users are restricted to surf on internet and I just want to grand access to one file so that they can use that spread sheet for short translations. The file works great, but only works for the Latin alphabet. I keep on getting “?” on English translation when I type Chinese. Below is the code for the file.</SPAN>
Code:
Public Function getGoogleTranslation(strSource As String, strSourceLang As String, strDestLang As String) As String
Dim strURL As String, x As String
strURL = "[URL]http://translate.google.com/translate_a/t?client=t&text[/URL]=" & _
Replace(strSource, " ", "%20") & _
"&hl=en&sl=" & strSourceLang & _
"&tl=" & strDestLang & "&multires=1&pc=0&rom=1&sc=1"
With CreateObject("msxml2.xmlhttp")
.Open "get", strURL, False
.send
x = .responseText
End With
getGoogleTranslation = Replace(Replace(Split(x, ",")(0), "[", ""), """", "")
'getGoogleTranslation = Replace(Replace(Split(x, Chr(34) & "," & Chr(34))(0), "[", ""), """", "")
End Function
here is the formula goes to cell which translates into English
Code:
=IF($C4<>"",getGoogleTranslation($C4,$B4,E$3),"")
Where
C4:"Chinese text that I typed"
B4:zh-TW (Code for Traditional Chinese)
E3: en (code for English)
I am sure there is something with ASCII setting but could not able to get.
If you want to see the original excel file you can downloaded below link(excelforum link)
Excel Help Forum
Thank you very much for your kind attention.
Baha