Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Toryalai 11 posts 81 karma points
    Oct 07, 2015 @ 16:25
    Toryalai
    0

    Right To Left (RTL) Language

    Great project,

    How to implement this plugin in right to left (RTL) language?

    Thanks in advance

  • dimi309 245 posts 579 karma points
    Oct 08, 2015 @ 02:05
    dimi309
    0

    That is kind, thank you! Would it work if you just add the dir="RTL" attribute in your content? For example:

    <p dir="RTL">some text in RTL</p>
    

    Otherwise, if there is some feature missing from the package that could help, please let me know and I will try to update it. I am sorry that I do not have a lot of experience with RTL languages, so I am not sure what the package should do.

  • Toryalai 11 posts 81 karma points
    Oct 13, 2015 @ 09:50
    Toryalai
    0

    Hi Dimitri,

    Many thanks for your response!

    I am stuck from last week to translate my website in RTL (Pashto and Dari), but I can't do that by proper way, could you please help me in this issue.

  • dimi309 245 posts 579 karma points
    Oct 13, 2015 @ 17:48
    dimi309
    0

    Hi Toryalai,

    If you tell me what the problem is maybe I can give some advice. Or if there is some feature missing from Polyglot that would help with RTL languages I could add it, if you let me know what is missing exactly.

  • Toryalai 11 posts 81 karma points
    Oct 14, 2015 @ 03:46
    Toryalai
    0

    Hi Dimitri,

    My problem is that, when I change language in drop down list from English to our local language (Pashto or Dari), the whole web site layout must be changed from LTR to RTL, but it's not.

  • dimi309 245 posts 579 karma points
    Oct 14, 2015 @ 17:03
    dimi309
    0

    You probably need to add some conditional statements in your views. For example, for the top HTML tag, you could do:

     @if (Request.RawUrl.ToLower().Contains("lang="))
        {
            var lang = Request.Params["lang"];
            if (lang== "(the RTL language)")
            {
             <html dir="rtl">
            }
           else
           {
           <html dir="ltr">
           }
         }
    

    The code above may not be 100% correct. I have just written it now without testing. But I think that that should be the general idea, even though I do not have much experience with RTL layouts... I hope this helps!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies