I am new to ruby on rails and I have just started watching rails casts tutorials.
I have understood on how to parse feeds using feedzirra if the feed is in English but if I have a feed like this wh开发者_JAVA技巧ich is in spanish then how do i parse this feed?
The link is
http://estaticos.marca.com/rss/futbol_equipos_almeria.xml
how do i convert this into English first before I save it into the database?
Thanks for the help & support
As KennyCason suggests, you can use the Google Translate API.
Google also has utility libraries for Ruby on Rails for you to get started.
I have not used this but should give you a start. I also highly doubt the accuracy of translation that google provides. One has to know the from and to language really good to analyze the translation. But i suppose Spanish<-->English should be pretty good.
Check out Google's AJAX Language API
http://code.google.com/apis/ajaxlanguage/
If what you are wanting is Machine Translation, then I recommend this or a similar solution.
And here's another more general link: http://googlesystem.blogspot.com/2008/03/google-launched-another-ajax-api-this.html
as Amit mentioned about Translation accuracy, for langauges that have a close grammatical mapping (English <=> Spanish) or (Japanese <=> Korean) you will obtain optimal translations, which will still fall short of any human translation, but should at least be understandable. Though (English <=> Japanese) for example, provides, in my opinion a very rough, and sometimes not understandable translations. Though It should suffice in most cases.
Note: If you are trying to make a multi-lingual website, you should probably set up a different infrastructure. And consider having humans Translate the text for you: Here is a quick and simple example I whipped up in the past for creating a multi-lingual website that uses associate arrays to store your "language pack" (could also use defines) http://ken-soft.com/?p=6, and another that is 100% Database backed. http://ken-soft.com/?p=496 (you could also mix them and have your database backed language packs exported into language files as in the first link I gave. (I will be doing a massive update to this sometime this week, so stay tuned, and ask me if you have any questions, also make note that the first link is probably more useful to most people)
精彩评论