Service Help – LanguageTrans
The Sharperlight service offers a wide variety of presentation methods, each with its own set of parameters.
In this post, we will introduce the following method from among the various presentation methods available.
http://abcd.com/mdService1Rest/LanguageTrans/…
LanguageTrans
To see this information with your sharperlight service help
{sharperlight service url}/Help#LanguageTrans
{sharperlight service url}/Help#LanguageTrans
|
Uses BING Translate as Google is a Paid Service If the from and to language are the same then it will just return the text as is JSON Example
http://abcd.com/mdService1Rest/LanguageTrans?text=Shopping&langfrom=en&langto=ja&response=jaon
JSON RESULT
{ text: “ショッピング” }
HTML Example
http://abcd.com/mdService1Rest/LanguageTrans?text=Shopping&langfrom=en&langto=ja&response=html&css=font-size:24px;color:red HTML RESULT
ショッピング
|
|
| langfrom=[en|ja|..etc] | Translate from language, defaults to English langfrom=en |
| langto=[en|ja|..etc] | Translate to language, for Japanese use ja and Spanish use es &langto=ja |
| text=[message] | Text to be translated |
| apiKey=[xxxxxxxx] |
BING Translate API Key. You will need to register and get your own API key. Note: You can hit limits if translating large volumes in a short amount of time. If you wait a few minutes the restrictions will reset. |
| response=[json|text|html] | The default is html |
| callback=[MyFunc] | JSON Callback function (Optional) &callback=MyFunc results in MyFunc( { text: “ショッピング” } ); |
| css=[html styling] | When returning html you can set the css styleing &css=font-size:12px;color:red |
