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 languageof the content you are trying to display.
<title>BBC Arabic News | الصفحة الرئيسية</title>
(You can see this feed live in IE here to see what RTL feeds look like).
Atom 1.0 header should look like this:
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ar">
The following languages will be displayedas RTL by default:
- Arabic (ar-**)
- Farsi (fa-**)
- Urdu (ur-**)
- Pashtu (ps-**)
- Syriac (syr-**)
- Divehi (dv-**)
- Hebrew (he-**)
- 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 Englishversion 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:
Hope this helps,
Software Development Engineer in Test