Feature #11784

{direction:rtl} doesn't work in text formatting

Added by Mahmood Jalilnejad about 5 years ago. Updated over 2 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:I18n
Target version:-
Resolution:Duplicate

Description

I need to write wiki/issue text in Right-to-Left languages
searching issue list , I found that "{background:color}" is added 7 months ago (revision r8860 , feature #2416)
Now , I need it to write {direction:rtl;text-align:right} or p{direction:rtl}>. like what is possible in the Qt Wiki Textile format

I am not an RoR developer, otherwise I might fix it myself


Related issues

Duplicates Redmine - Feature #8121: Allow overriding direction of part of text Closed 2011-04-10

History

#1 Updated by Boaz Rymland over 4 years ago

+1. I'd be happy to see this implemented. RTL is very basic these days... . Thanks.

#2 Updated by Toshi MARUYAMA over 4 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

Duplicate with #8121.

#3 Updated by Ali Nadalizadeh over 2 years ago

Temporary fix for persian users which converts the whole wiki paragraph to RTL (once detects persian/arabic content):

<script>
$(document).ready(function() {

$.each($(".wiki, .wiki-edit"), function(i,v){
    var txt = $(v).text();
    for(ci in txt) {
        if (txt.charCodeAt(ci) > 0x600 && txt.charCodeAt(ci) < 0x700) {
            $(v).css("direction", "rtl");
            break;
        }
    }
});

$.each($(".issue .subject a"), function(i,v){
    var txt = $(v).text();
    console.log(txt);
    for(ci in txt) {
        if (txt.charCodeAt(ci) > 0x600 && txt.charCodeAt(ci) < 0x700) {
            $(v).parent().css("direction", "rtl");
            $(v).parent().css("text-align", "right");
            break;
        }
    }
});

});
</script>

Append the code above to the main layout file (app/views/layouts/base.html.erb) or any other javascript file which is included in all pages.

Also available in: Atom PDF