Reading feeds in Right-to-Left order


In the last few weeks, we have got some questions about how to display the IE7 Feed View in RTL (Right-To-Left) reading order, which is used by several languages.

The good news: we do have support for RTL.

IE decides whether to show a feed in RTL reading order based on one of three things:


  • The language that the feed publisher specifies in the feed

  • The default language of the browser (only if the publisher does not specify a feed language).

  • The manual reading order selection that the user makes (overrides either of the previous two)

If you are a publisher of an RSS Feed, here is what you need to do to make it show correctly.

IE‘s Feed View is looking for the RSS 2.0 language element (e.g. <language>en-us</language>), or the XML xml:lang attribute for Atom 1.0 feeds (<feed xml:lang=”en”>)  to determine which direction the feed page should have.

If the language the publisher indicates is known to be displayed RTL by default, IE will automatically switch the ordering. In this examples above (en is “English”), the feed will display as LTR (Left-To-Right). Conversely, if the language element is set to Arabic (<language>ar-SA</language> or just <language>ar</language> for RSS 2.0) the feed will be displayed in RTL (Right-To-Left) order.

Here is what the header of the feed should look like. The value of the language element should be changed to any of the values shown below, depending on the language of the content you are trying to display.


<?xml version=”1.0″?> 
   <rss version=”2.0″><channel> 
   <title>BBC Arabic News | الصفحة الرئيسية</title> 
   <link>http://news.bbc.co.uk/go/rss/-/hi/arabic/news/default.stm</link>
<language>ar</language>


(You can see this feed live in IE here to see what RTL feeds look like).

Atom 1.0 header should look like this:


<?xml version=”1.0″?>
   <feed xmlns=”
http://www.w3.org/2005/Atom” xml:lang=”ar”>


The following languages will be displayed as RTL by default:


  1. Arabic (ar-**)

  2. Farsi (fa-**)

  3. Urdu (ur-**)

  4. Pashtu (ps-**)

  5. Syriac (syr-**)

  6. Divehi (dv-**)

  7. Hebrew (he-**)

  8. Yiddish (yi-**)

Please note: the language value must be in lowercase (e.g. ar-SA, he-IL, ur-PK, etc.). The second part of the value (which typically indicates the region), is not used in any way by IE’s feed view, and may be omitted.

When the language tag is not included by the publisher, the default IE language is used. For example, if you’re using an English version of IE, then all feeds without the language element are treated as LTR. If you’re using a Hebrew version of IE, then a feed without the language element is treated as RTL.

Finally, there are times when the feed’s language is different from the default language, and the feed language element is not set by the publisher.  In this case, you can manually change the layout to RTL or LTR using the Page menu, encoding-> Right-to-Left Document: or via right-clicking directly on the page itself. See image below:

clip_image001


Hope this helps,


Nick Achmon,
Software Development Engineer in Test

Comments (36)

  1. James Snell says:

    While direction guessing based on the language can, obviously, work sufficiently in many cases, I would definitely be interested in your opinion of the Atom bidi attribute draft – http://www.ietf.org/internet-drafts/draft-snell-atompub-bidi-03.txt, which allows the direction to be set explicitly.

  2. James Snell says:

    Doh! Sorry, I updated the draft and forgot to update my own link to it! http://www.ietf.org/internet-drafts/draft-snell-atompub-bidi-04.txt

  3. rss says:

    James,

    Being able to set explicit directionality in a feed is certainly a useful tool for publishers to exercise more precise control over the display of their content.

    However, I also believe that allowing a publisher to simply specify the feed language, and having the reader "do the right thing" automatically is just as powerful. The set of modern languages that use rtl ordering is finite, so it is not an intractable problem.

    Either way, the draft appears to be fine – the design aligns nicely with the (X)HTML “dir” attribute (which is good :). I think that in the long-run, readers should consider implementing both language-based detection, and support for the dir attribute as a way for publishers to override of the default behavior. It’s certainly something we will be looking into in the future.

    Thanks for the comments and the reference.

    – Sean Lyndersay

  4. For the record, I had considered implementing language-based detection, and reached the conclusion that it would do more harm than good. Obviously, aggregator authors will make their own decisions regarding how to deal with bidirectionality, but I would’t recommend what IE is doing (at least not without more evidence that there was some value in this approach).

    If you’re interested, the process we use in Snarfer is described at the end of this post:

    http://www.詹姆斯.com/blog/2006/12/right-to-left-rss

  5. bajaifir says:

    حاولت ان اجعل الغذاء باللغة العربية ولم انجح في ذلك هل احد تمكن . شكرآ لكم  

  6. Long says:

    Hi,

    do you know how to setup in internet explorer 7 encoding "CENTER document" instead of  Right-to-Left document or Left-to-Right document ?

    many thanks

  7. RSS Response says:

    !ti t’nsi emit tuoba s’ti ,uoyknaht

  8. RSS Blog says:

    Very good . You are doing a great job.

  9. eo2 says:

    I wish a better integration with actual email clients

  10. MPcomputer says:

    Great!!!

    it is very good for persian ( farsi ) language .

    با تشکر فراوان به خاطر توجه به این نکته بسیار مهم برای فارسی زبان ها

    با آرزوی موفقیت

  11. There are some problems with this approach, as I see it.

    [1] What will you do about Azerbaijani, etc.?  Azerbaijani language is written in both RTL (Arabic) and LTR (Cyrillic) scripts, depending on where you live. Basing the choice on language  (az in each case) doesn’t scale for that type of situation.

    [2] How do you cater for feeds where entries are in one language or another, or a mixture of both?  This is quite common. Rather than declaring the directionality at the feed level, you need to declare it at the item level and/or  within an item with mixed direction text.

    [3] The language subtag should not be required to be case-sensitive, since this is not required in the original formats (see BCP 47).

    I think you are limited here by the lack of proper bidi handling in the RSS and Atom formats, so looking at language is a workaround that addresses many cases reasonably well. I believe you should express it this way in your article above – not imply that this is a perfectly fine solution.

    I hope that helps.

  12. Tweaks says:

    For the record, I had considered implementing language-based detection, and reached the conclusion that it would do more harm than good. Obviously, aggregator authors will make their own decisions regarding how to deal with bidirectionality, but I would’t recommend what IE is doing (at least not without more evidence that there was some value in this approach).

  13. Great Job. Just what I was looking for.. It’s good for  multilanguage sites.

  14. Seems like mixture of two languages in case of Azerbaijani is too much 😉

  15. Simon says:

    Molto interessante. Lavoro ben fatto.

  16. Pastedump says:

    Very Good. I was looking for this.

  17. Pastedump says:

    Very Good. I was looking for this.

  18. It’s a stiupid idea. That is my opinion, bezause i read left to right. 😉

  19. Boszkowo says:

    Very Good. I was looking for this.

  20. Great article. It`s realy worth reading. I wish you further successes

  21. les1 says:

    Słabo znam angielski ,więc w swoim ojczystym języku muszę stwierdzić ,że jest to dobry pomysł 🙂

  22. Suplementy says:

    I think it is a very good solution

  23. omaha rules says:

    Obviously, aggregator authors will make their own decisions regarding how to deal with bidirectionality, but I would’t recommend what IE is doing

  24. Matta says:

    Am using this successfully in publishing content in English (one RSS feed) and Arabic (another RSS feed).

    Explicitly determining the direction can be dangerous, if not well thought through. In Arabic numerals are written Left to Right within Right-to-Left text. Forcing RTL as a direction will change this. Sometimes–e.g. dates expressed as text, or code numbers for items, etc.–this forcing of RTL is required. Most times, it is not the interpretation a native would expect.

  25. tulkSpulp says:

    visit us!

    newsbox.cc

    newsbox.us

    nbstatus.wordpress.com

    NOW!

  26. Lodeopelp says:

    http://www.dug-portal.com/

    BESUCHT UNS JETZT – VISIT US NOW!

  27. eredayDyegorb says:

    http://www.dug-portal.com/

    BESUCHT UNS JETZT – VISIT US NOW!

  28. UGG Classic Cardy says:

    Only One word to characterize such a great post “WOW” that was a very interesting read

  29. Explicitly determining the direction can be dangerous, if not well thought through.Thanks.

  30. One word to characterize such a great post “WOW” that was a very interesting read. Thanks.

  31. best websites says:

    Really great news for Right-to-Left language users! You are doing a great job. Now the websites should add the language value on their rss feeds.

  32. very tnx this is poniter for persianlanguage

  33. Netlinking says:

    Plutot que de vous inscrire sur des annuaires de mauvaise qualité et de perdre votre temps faire appel au Netlinking permet de s’assuré que les liens serons de qualité, en nombre suffissant mais sans en mettre de trop.

    Le Netlinking vous permet de géré de maniére chirugicale votre référencement et de l’optimisé juste se qu’il faut.

    Notre capacité de Netlinking repose sur un réseau de partenaire solide ayant fait ces preuves dans le domaine du Netlinking.

  34. <a href="http://www.hayda.net" title="chat, sohbet, muhabbet, chat sohbet, ask sohbet">chat</a> says:

    That is very good comment you shared.Thank you so much that for you shared those things with us.Im wishing you to carry on with ur achivments.All the best.

  35. vahid says:

    Very good . You are doing a great job.

Skip to main content