Difference between revisions of "Automatic Feed Translation"

From AwasuWiki
Jump to: navigation, search
(Automatic Feed Translation)
Line 4: Line 4:
  
 
Download and save this file somewhere:
 
Download and save this file somewhere:
     [http://www.awasu.com/downloads/extensions/AutoTranslate/AutoTranslate.xsl AutoTranslate.xsl]
+
     [http://www.awasu.com/downloads/extensions/AutoTranslate/AutoTranslate-v2.xsl AutoTranslate-v2.xsl]
  
 
==Customising the XSLT file==
 
==Customising the XSLT file==

Revision as of 12:34, 4 October 2010

Automatic Feed Translation

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:

   AutoTranslate-v2.xsl

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": AutoTranslateEventViewer.jpg

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

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.