Ticket #6425 (assigned enhancement)
Support for RTL in feeds
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | I18N | Version: | |
| Severity: | normal | Keywords: | rtl-feedback close |
| Cc: | ramiy, tomer |
Description
In the current state of most Feed readers, the only surefire way to make RTL content display properly is to have directionality enforced inside the content - that is, either with {{<div dir="rtl">}}} tags inside CDATA or with Unicode directionality characters (for e.g., RLE and PDF, or ‫ and ‬, or U+202B and U+202C.) for excerpts or titles.
While we currently have pretty good support for RTL languages, there is no support for RTL in feeds - all is left up up to the feed reader.
I suggest adding a mechanism to automatically insert these tags/characters for blogs that have text_direction set to RTL - much in the same way RTL css style sheets are loaded for these blogs.
I have attached a patch that modifies the feed templates to insert these tags/characters. Note that there is no checking of blog directionality here - this is just an example of how to enforce RTL in feeds, not how to enforce it conditionally.
This relate to a previous ticket I submitted (#5517), regarding adding an option to set the feed language - which currently just defaults to EN. Certain feed readers know to display RTL text in proper directionality according to feed language (for e.g., feeds that have their feed language set to HE (Hebrew), will get displayed from Right to Left). While setting feed language is not a comprehensive solution, it is a step in the right direction.
Attachments
Change History
RanYanivHartstein — 4 years ago
-
attachment
rtl-feeds.patch
added
- Keywords has-patch 2nd-opinion added
- Summary changed from Support for RTL in fees to Support for RTL in feeds
I'm enclosing a better patch to address the feed directionality issue. It adds directionality characters where needed according to the text_direction option.
However. it is not a very efficient approach at solving this problem, and improvements are welcome.
A better approach might be and individual check of the prominent script used in every post, comment and title - directionality can be set according to that script.
For e.g., while many Israeli bloggers write most of their posts in Hebrew or Arabic which are RTL scripts, we should be able to identify the occasional English post or title and set it to LTR.
This is also true for comments - some visitors may be fluent Hebrew or Arabic readers, but are more comfortable commenting in English. Their comments should be displayed properly, from left to right.
Such behavior can be based on work done in Comment Directionality Plugin by Tom Sella (it currently supports only Arabic, English and Hebrew)
http://www.dontsmile.info/downloads/comment_direction-1.2.zip
RanYanivHartstein — 4 years ago
-
attachment
better-rtl-feeds.patch
added
Better patch for setting directionality in feeds
- Owner changed from anonymous to nikolay
- Milestone changed from 2.7 to 2.9
- Keywords needs-patch added; has-patch 2nd-opinion removed
- Milestone changed from 2.9 to Future Release
comment:5
nbachiyski — 2 years ago
- Owner changed from nikolay to nbachiyski
- Status changed from new to assigned
you can replace:
<?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?>
with:
<?php if ( is_rtl() ) { echo '‫'; } ?>
- Type changed from enhancement to task (blessed)
- Milestone changed from Future Release to 3.4
comment:9
in reply to:
↑ description
nacin — 4 weeks ago
Replying to RanYanivHartstein:
In the current state of most Feed readers, the only surefire way to make RTL content display properly is to have directionality enforced inside the content...
This ticket was opened four years ago. Can we have an update on the current state of more modern feed readers?
Cursory research suggests that feed readers can/do use the feed language to figure out whether content should be displayed RTL. If this is true, #13440 would fix this.
comment:11
nacin — 2 weeks ago
- Keywords close added; needs-patch removed
- Type changed from task (blessed) to enhancement
- Milestone changed from 3.4 to Awaiting Review
Pulling this off the 3.4 milestone, as I have doubts.
Feedback requested here as well: http://wppolyglots.wordpress.com/2012/02/07/need-some-rtl-feedback-here-http-core-trac/. A comment there indicates what I had learned — that Google and IE readers both detected.

Patch to enforce RTL in feed templates