Free Automatic Translation Within Netsuite using Yandex Translate API
In this challenge I decided to integrate Netsuite with Yandex Translate REST API for the following reasons:
- Free version includes:
- Up to 10 million characters a month (or 322,580 characters per day spread evenly in 31 days)
- Up to 1 million characters in 24 hours (would last 10 days only as max is 10 million per month)
- Translation quality is decent.
- Great for small translation projects.
Let’s say we want to translate a FreeText field, that has a max of 300 characters so that would allow me for a max workload of around 1,075 translations per day, and that’s maxing out all 300 characters per request. Not bad.
Getting started is really easy:
- Go to https://tech.yandex.com/translate/
- Get a free API Key (You might need to register)
- Call the Yandex API within Netuiste (Follow the code example below)
I tested this on an after submit script that translates the memo field and saves the result in another field called “Memo in Spanish”
Don’t forget to check Yandex Translate API documentation to learn more about the languages and more features such as auto detecting languages.
Here’s the code example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\ || This user event script translates Memo text into || || "Memo in Spanish" field after submit || || || || || || Version Date Author Remarks || || 1.0 Dec 01 2016 Adolfo Garza Initial commit || \= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ var APIKEY = 'trnsl.1.1.20161201T045'; //<< Replace with your key var URL = 'https://translate.yandex.net/api/v1.5/tr.json/translate?key=%API-KEY%'.replace('%API-KEY%', APIKEY); function afterSubmit() { var memo = nlapiGetFieldValue('memo'); var memoInSpanish = translateText(memo, 'en-es'); //<< You can set language here nlapiSubmitField(nlapiGetRecordType(), nlapiGetRecordId(), 'custbody_memo_in_spanish', memoInSpanish); } function translateText(text, lang){ var reqBody = {text: text, lang: lang}; var reqUrl = URL; var myResponse = nlapiRequestURL(reqUrl, reqBody); var responseBody = JSON.parse(myResponse.getBody()); var responseTextArray = responseBody.text || []; var responseText = responseTextArray.join(' '); return responseText; } |
Pingback: how to make money with a iphone()
Pingback: Bolide()
Pingback: DMPK Studies Labs()
Pingback: how to make money with a iphone()
Pingback: alpha dog training()
Pingback: Best Engineer Aws Alkhazraji()
Pingback: Bdsm chat()
Pingback: http://ptba.co.id/id/career()
Pingback: Colarts arab()
Pingback: diyala Aws()
Pingback: iq iq Aws Alkhazraji()
Pingback: astrology()
Pingback: full time equivalent services for chemistry()
Pingback: informatica serviços()
Pingback: house for sale()
Pingback: miami commercial real estate()
Pingback: find a real estate agent()
Pingback: forex advisor()
Pingback: warehouse for sale()
Pingback: guaranteedppc.com()
Pingback: locksmith ppc managment()
Pingback: special info()
Pingback: 먹튀신고()
Pingback: reddit ppc()
Pingback: freemoviesz()
Pingback: Social Media services in India()
Pingback: Online Brand Management()
Pingback: satta matka, satta king, satta, matka, kalyan matka()
Pingback: Array Questions()
Pingback: free forex signals()
Pingback: cash advances()
Pingback: hoverboard()
Pingback: Elizabeth Bay Locksmith()
Pingback: download for scribd()
Pingback: victor martinez bodybuilder net worth()
Pingback: bulk 4cmc()
Pingback: iq iq()
Pingback: in vitro ADME services()
Pingback: garcinia cambogia amazon()
Pingback: judi ceme online()
Pingback: transport medyczny międzynarodowy łódź()
Pingback: cheap online viagra()
Pingback: kaufen steroide()
Pingback: top kiwi casino sites()
Pingback: newtube sirius777 abdu23na312 abdu23na98()
Pingback: voirfilms.lu()
Pingback: help me write a essay()
Pingback: thesiswritinghelpsjj.com()
Pingback: custom essay station()
Pingback: doctoral dissertation database()
Pingback: essay title help()
Pingback: essays about service()
Pingback: write my college paper()
Pingback: purchase research paper online()
Pingback: thesis binding service()
Pingback: cialis coupon()
Pingback: cialis without a doctor prescription()
Pingback: cialis buy online()
Pingback: cialis for sale()
Pingback: cost of viagra()
Pingback: viagra connect cvs()
Pingback: viagra effects()
Pingback: pills like viagra over the counter()
Pingback: top rated online canadian pharmacies()
Pingback: online pharmacy canada()
Pingback: medical information online()
Pingback: online pharmacies uk()
Pingback: buy prescription drugs from canada()
Pingback: viagra()
Pingback: viagra vs cialis reviews()
Pingback: do i need prescription for cialis in usa()
Pingback: cialis doesn\'t work?()
Pingback: cost of tadalafil without insurance()
Pingback: buy original cialis online()
Pingback: buy cialis doctor()
Pingback: generic cialis express delivery()
Pingback: online viagra usa()