Automatic feed translation

Contributed by kevotheclone
Google has announced that the Google Translate API, upon which this Awasu extension is based, has been officially deprecated as of May 26, 2011.

You can automatically translate a foreign language feed into your language, utilizing Google's Translation API, whenever Awasu updates the associated Channel. Here is the list of supported languages.

Download and save this file somewhere.

Customising the XSLT file

Your language

There is a constant in the XSLT file called "yourLanguage" which you can change to a specific two-character language code of your language. If your language is English, the XSLT file below should work well without any modification.

Feed language

There is a constant in the XSLT file called "feedLanguage" which you can change to a specific two-character language code if you know the language of the feed; this will improve Google's language translation accuracy. Leaving the "feedLanguage" constant blank (empty quotation marks: "") should still work as Google will attempt to guess the feed's language. More information about setting the feed language is provided below under the "Error Reporting" section.

Error Reporting

Due to the nature of XSLT processors, it is impossible to output error information in such a way that Awasu could capture it and display it in the Channel Properties dialog box. So as an alternative error reporting mechanism, any errors will be logged in the Windows "Application" Event Log. Two types of errors are reported: 1) Problems connecting to the Google Translation service, and 2) problems reported by the the Google Translation service.

These events will have "WSH" as the "Source":

Double-clicking on one of the events will show the detail error code and description of the problem:

The most common problem I encountered when testing this XSLT was a "400" error code from Google with this description "could not reliably detect source language". By setting the feed language to a specific two-character language code I was able to eliminate this type of error completely. If a feed item fails to translate you can manually translate it using these Send-To User Tools.

So you may want to keep the AutoTranslate.xsl file with the field language blank, but make copies of it and add specific two-character language code of the languages that you translate the most. You might rename the copied files something like this: AutoTranslate_ES_to_EN.xsl (Spanish to English), AutoTranslate_PL_to_EN.xsl (Polish to English), etc.