rogeshu1990
rogeshu1990

Reputation: 15

How to optimise Google Translate API calls to translate multiple words in a single request

Everyone. Recently Google Translate Is Integrated Into My Project, Which Plays The Role Of Translating Some Product Names, Product Descriptions, Product Related Category Names. But Cause There Are Plenty Of Products In My Database(And Increased Quickly), Google Translate Api Would Cost Considerable Money.

I Want To Translate By Google As Less As Possible. In The Translation, Many Words Are Same Among Many Products, For Example : 阿迪达斯 - Adidas, 苹果 - iphone, 篮球 - Basketball, Bla Bla..... I Wanna Do Some Tricks, But Find No Idea. Did Anyone Encounter Such Questions?

Any Help Would Be Appreciated.

Upvotes: 1

Views: 1647

Answers (2)

user2584406
user2584406

Reputation: 26

It sounds like what you need is actually the ability to reuse translation at the string or substring level (in other words, per database entry). You can't really do that with Google, that I know of. You've got a few options, as I see it:

  • You could switch over to Microsoft Translator and use their methods that allow you to place translations yourself, such as their Collaborative Translation feature that lets you override the MT with a preferred translation and even to vote translations up/down. Quality here will be broadly comparable to Google (I often find it better), and you have methods at your disposal that allow this override. Also, unlike Google, the Microsoft API is free up to a certain volume. Take a look:
    http://www.microsoft.com/en-us/translator/developers.aspx
  • Microsoft also has a unique feature called the Microsoft Translator Hub, which can use your terminology, for example, for translations. However,depending on how you implemented any solution with Microsoft, you might still have the problem that you are making more calls out to Microsoft than you'd like, and, moreover, that "matching" only takes place at the level of a whole record or string, so it would not hit the case of shared linguistic elements being concatenated into one string.

  • There's a commercial offering called GeoFluent (full disclosure--I am the product manager for this product, so I'm clearly biased :)) that works with Microsoft Translator but provides pre and post translation processing that can deal with sub-segment and may reduce the volume you are therefore putting through translation each time. It could make sense if, as you mention, you are rapidly adding to your database. Of course, this is a commercial offering too, so you'd have to balance the costs. Let me know if this helps, and happy to answer any other questions you have. Marcus

Upvotes: 1

Preet Sangha
Preet Sangha

Reputation: 65536

There is a PHP sample here : http://weblite.ca/svn/dataface/modules/tm/trunk/lib/googleTranslatePlugin.php

That allows you to send and array and return an array.

array(source=>target) getTranslations()

  • translates all of the user provided strings into the target language using the Google Translate API and returns an array of source=>target strings.

Upvotes: 0

Related Questions