Opened 17 years ago
Last modified 2 years ago
#6425 assigned enhancement
Support for RTL in feeds
Reported by: | RanYanivHartstein | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Feeds | Keywords: | needs-refresh close |
Focuses: | rtl | Cc: |
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 (2)
Change History (20)
#1
@
17 years ago
- 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
#3
@
16 years ago
- Keywords needs-patch added; has-patch 2nd-opinion removed
- Milestone changed from 2.9 to Future Release
#7
@
14 years ago
you can replace:
<?php if ( get_bloginfo('text_direction') == 'rtl' ) { echo ('‫'); }?>
with:
<?php if ( is_rtl() ) { echo '‫'; } ?>
#8
@
13 years ago
- Milestone changed from Future Release to 3.4
- Type changed from enhancement to task (blessed)
#9
in reply to:
↑ description
@
13 years 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.
#11
@
13 years ago
- Keywords close added; needs-patch removed
- Milestone changed from 3.4 to Awaiting Review
- Type changed from task (blessed) to enhancement
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.
#17
@
10 years ago
- Keywords needs-refresh added; close removed
Patch no longer applies cleanly and Feedly does not appear to be parsing language or RTL characters.
Do we want to continue to pursue this ticket? If so, the patch needs an update and we should aggregate a list of feed readers that support this functionality.
#18
@
2 years ago
- Keywords close added
It isn't clear if today is still a problem.
There is an old plugin with 30+ with the latest release 8 years ago https://wordpress.org/plugins/rtl-rss-feed-fixer/ that implement the same thing proposed in the ticket, adding the text direction value and some CSS for that with HTML parsing to any paragraph.
The code it is also on github https://github.com/barzik/rtl-feed-fixer but updated since 2015.
Maybe we can ask the WordPress communities with RTL languages to understand is still a real problem?
Patch to enforce RTL in feed templates