Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    This little Earth.
    Posts
    383
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy More arabic/english stuff...text direction?

    well i figured unicode was the way to go here. Not supported by every single browser out there but good enough for the majority.
    BUT i'm now having text direction probs.
    Here's the issue.
    I have arabic text that SHOULD appear like so:


    they're two different words, each in a different color (just to clarify).

    now, because Arabic is a right-to-left language, i should probably be adding dir:rtl to my stylesheet.

    which I did. i've got a table in which some of the text is arabic and some english, within the same cell. wherever it's arabic it's in a span with dir:rtl.
    It doesn't work.

    If I change the whole page and add dir:rtl to the entire body's style, then it works. But I can't do that because the entire page goes right to left, including table formatting, english, and everything. so that's why i specified this only in my "ar" span for arabic text:

    .ar{
    dir:rtl;
    lang:"ar-SA";
    font-size:20;
    }

    Why doesn't it work?

    Instead of showing as it ought to, it ends up with the words in the wrong order, like this:

    the text is supposed to say "don't beat", but instead it says "beat don't"...
    Last edited by ASAAKI; 03-12-2003 at 02:32 PM.
    'If you don't stand for something, you'll fall for anything.'

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think you're real close to what you want, the problem with using <span> is that it isn't a block level element and I believe the "dir" applies at the block level. Try using <div> instead of span.

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    This little Earth.
    Posts
    383
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i tried it. still not working .
    'If you don't stand for something, you'll fall for anything.'

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Location
    This little Earth.
    Posts
    383
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it's working!!
    it didn't work with <p> or <table> or <div> or any block level element, the only thing it worked with was <body>. i think that might be because i'm not just using plaing html with "dir", i'm also using Unicode encoding.

    so i used <BDO dir="rtl">....</BDO> within a span or div and it worked as i wanted it.

    but i'm not sure if this is really the most appropriate way to do it?
    'If you don't stand for something, you'll fall for anything.'

  • #5
    Regular Coder
    Join Date
    Jan 2003
    Posts
    680
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ASAAKI, you don't have to resort to that!
    You missed one bit in the spec. You also need a little 'bidi-override' (which corresponds to the HTML element BDO... )

    Try this:

    --------
    .multi span { unicode-bidi: bidi-override; direction: rtl }

    <p class="multi">
    There was <span>a lady</span> of Venice <span>who used</span> hard-boiled eggs <span>to play</span> tennis.</p>
    --------
    (o<
    //\ &nbsp; &nbsp; &nbsp; =^..^=
    &nbsp; &nbsp; $!

  • #6
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    krycek applauds

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."

  • #7
    Regular Coder
    Join Date
    Jul 2002
    Location
    This little Earth.
    Posts
    383
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok i've taken a while to reply here..
    i tried the tennis lady thingie, it did work, thanx meow.
    just a couple of quick questions.
    why shouldn't i use BDO? is it a 'bad' thing to do? deprecated or something?
    about bidi-override... is it compatible with earlier browsers?
    'If you don't stand for something, you'll fall for anything.'

  • #8
    Regular Coder
    Join Date
    Jan 2003
    Posts
    680
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No, neither BDO nor dir are deprecated to my knowledge.

    Don't take my word for this now. I have never actually used this, just played around with it. According to my modest testing neither method work in Opera or Netscape 4. Both methods work in IE (at least 5 up) and Moz. So why not choose CSS? It feels like "the right thing to do" and it would be way more flexible. You can just dump class="baclwards-language" where you want it and type away.

    Uhm. Don't know about Mac and nix browsers.
    (o<
    //\ &nbsp; &nbsp; &nbsp; =^..^=
    &nbsp; &nbsp; $!

  • #9
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by meow
    Don't know about Mac and nix browsers.
    I have both - if you whip up a test page I'll be happy to check it out.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #10
    Regular Coder
    Join Date
    Jan 2003
    Posts
    680
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sure, whip-whip!
    (o<
    //\ &nbsp; &nbsp; &nbsp; =^..^=
    &nbsp; &nbsp; $!

  • #11
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Linux - works in Moz but not Konqeuror (3.0.3)

    Mac tests coming later (when I get home)
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #12
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Mac - only mozilla worked ... ie5 and safari didn't
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #13
    Regular Coder
    Join Date
    Jan 2003
    Posts
    680
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not the standard text either? Or just not the hover thing?

    IE5 Win handles the ordinary backwards lines, but not the hover.
    (o<
    //\ &nbsp; &nbsp; &nbsp; =^..^=
    &nbsp; &nbsp; $!

  • #14
    Regular Coder
    Join Date
    Jul 2002
    Location
    This little Earth.
    Posts
    383
    Thanks
    0
    Thanked 0 Times in 0 Posts
    then would be it better to simply use the BDO element?
    'If you don't stand for something, you'll fall for anything.'

  • #15
    Regular Coder
    Join Date
    Jan 2003
    Posts
    680
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not on Windows. The support seems to be the same for both methods. The hover was just for fun.

    Have to ask brothercake about Mac browsers.
    (o<
    //\ &nbsp; &nbsp; &nbsp; =^..^=
    &nbsp; &nbsp; $!


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •