Ticket #39 (closed enhancement: fixed)
RSS feed for particular languages
| Reported by: | mail@… | Owned by: | ofer |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.5 - Beta wordpress plugin |
| Component: | WordPress Plugin | Version: | 0.2.2 |
| Keywords: | Cc: |
Description
I would like to be able to provide an RSS feed with all the articles in a particular language. Is this possible?
Change History
comment:1 Changed 3 years ago by anonymous
- Priority changed from major to minor
- Component changed from Parser to WordPress Plugin
comment:2 Changed 3 years ago by mike@…
/endorse
Tangentially, I'd also like transposh to interact with other plugins that build XML sitemaps, so that those carry all of the alternate-language data as well as the main language.
comment:3 Changed 3 years ago by mail@…
To add to this. If the option to [mark articles as complete](http://trac.transposh.org/ticket/44) (for a particular language) is implemented, this RSS feed could then have the articles for a particular language, as they are marked.
So the feed for each language wouldn't list articles by the time they were posted, but by the time they were translated. This would allow people who subscribe to it when a new translation is ready, even if it was of an old article, rather than wjust when one of the newest articles are posted & translated.
comment:4 Changed 3 years ago by ofer
- Status changed from new to accepted
This will take time, but I generally agree with what you have written here, feeds have started to work now, but this is not a good solution yet. Need to think of something.
comment:5 Changed 2 years ago by datapharmer
I was able to get feeds working by modifying /wp-includes/feed-rss2.php on lines 37 and 43. It is a hack and will get replaced if wordpress is upgraded. The changes are as follows:
37: <link><?php the_permalink_rss() ?>?lang=<?php echo $GLOBALS['lang']; ?></link> 43: <guid isPermaLink="true"><?php the_permalink_rss() ?>?lang=<?php echo $GLOBALS['lang']; ?></guid>
A hook could be added to modify the_permalink_rss so that the wordpress core files don't need to be modified.
The guid is going to be the toughest part. You can't use the_guid because you would need to add an ampersand which kills the feed validation and breaks it in some readers such as firefox. It may be possible to generate a true guid somehow which would get around this problem as well; a guid is needed though because each language is a unique page and you don't want them all pointing at the same post. This fix will also cause trouble under some permalink circumstances - anything pith ?p= for example.
Let me know if I can be of any further assistance!
comment:6 Changed 2 years ago by ofer
Well
Seems like feeds are working for me, but only after a second reload of a feed, first reload brings the parsing errors. I guess there might be something wrong in the fetching process somehow.
I am not sure what your patch comes to solve, you want the feeds to accept the language parameters? I am testing with permalinks, seems fine.
I also highly appreciate your inputs, keep them coming, and if you can assist, this is always welcomed
comment:7 Changed 2 years ago by datapharmer
Yes, I passed the language parameter because (at least for me) while the feed itself was translated, the page or post it is linked to is not. For example, if you go to website.com/es/feed it displays the feed contents in spanish, but if you click the first link (or any subsequent one) it goes to the english version. The expected action is that it would go to the spanish version. This is important for readers as they will have to click on the feed link and then click again on a translation and it is also bad for seo since the google xml sitemaps plugin doesn't recognize the transposh generated pages it is possible to submit feeds as additional sitemaps to google and other search engines, but the feeds will just point back to the default language pages. The hack I suggested fixes that. Perhaps a better way would be to avoid the ?lang and insert the inline language url ie website.com/[lang]/category/page which would resolve to potential permalinks issue (ampersand causes problems).
Other than not passing the parameter the feeds are generally okay. One other problem I am having is that content that is being translated on the pages is sometimes not being translated in the feed excerpts. I have a couple sentences in my dansk feed for instance that are still appearing in english but are translated fine on the actual posts, and there doesn't appear to be any way for the user to correct this behavior since there is obviously no edit option on the feed page.
