Skip to main content

Right-to-Left Support in chats reposnses

Please add support for Right-to-Left text direction in chat responses. This is a critical feature for Arabic users.

RTL support is only needed for chat responses, not for the overall UI.

Thank you

Status: Completed14 comments

Log in to comment and vote

Comments14

  • Daniel Nguyen

    Team•

    Dec 8, 2025

    I’ve added this in v2.3.1. Can you give it a try. Thanks

    • Rakan Alkhnaini

      •

      Dec 8, 2025

      THANK YOU DENIAL 🤝

      Works as expected 👏

    • meshari

      •

      Dec 8, 2025

      This is absolutely awesome! I can now read Arabic content so easily - what a game changer! I'm super grateful for your lightning-fast support, you guys rock! This update is honestly a huge deal for me and makes my workflow so much smoother. Definitely keeping me as a happy user!

    • Rakan Alkhnaini

      •

      Dec 10, 2025

      Hi Denial,

      For future enhancement in this matter, It would be great to to extend the support of RTL to:

      1. Workflow responses

      2. Writing in the chats

      3. Mobile version (the chat responses still LTR)

      Thanks

      Rakan

  • Daniel Nguyen

    Team•

    Dec 6, 2025

    Thanks. I’ll try to improve it. Any chance you can share a screenshot so I understand it better.

    • Rakan Alkhnaini

      •

      Dec 6, 2025

      Thanks for your prompt response!

      You can check the screenshot below. This is an alignment issue where it shows the response left to right, assuming it's English, when it should know the context

      is Arabic and it should display the response right to left.

      Note that both ChatGPT app and Gemeni they align the resonances correctly with the conversation is in English or Arabic.

      • Rakan Alkhnaini

        •

        Dec 6, 2025

        I let AI explain the issue since I’m not a technical guy

        Explaining RTL (Right-to-Left) Issues with Mixed Arabic-English Text

        The Problem

        When Arabic text (RTL language) contains English words (LTR language) and the interface doesn't properly support RTL, the text becomes confusing and hard to read because:

        Visual Example

        Without RTL support (WRONG):

        .Python programming language ال أنا أحب
        

        The sentence reads incorrectly - English words appear in wrong positions.

        With RTL support (CORRECT):

        أنا أحب ال Python programming language.
        

        The sentence flows naturally from right to left, with English embedded correctly.

        Why This Happens

        1. Arabic reads right-to-left (←)

        2. English reads left-to-right (→)

        3. Without proper RTL support, the browser/app doesn't know how to handle bidirectional text (BiDi)

        4. Text alignment, punctuation, and word order get scrambled

        Real User Impact

        • Readability: Users can't understand responses properly

        • Professionalism: Looks broken and unprofessional

        • User experience: Frustrating to parse jumbled text

        • Code/technical terms: English variable names, commands, or technical terms appear in wrong places

        The Technical Fix Needed

        /* Add this to the chat message container */
        .chatbot-message {
          direction: rtl;
          text-align: right;
          unicode-bidi: embed;
        }
        

        Or detect the language and apply dir="rtl" attribute dynamically to Arabic messages.


        Bottom line: Without RTL support, Arabic responses with English words look like scrambled nonsense to Arabic users. 🔄

      • Daniel Nguyen

        Team•

        Dec 6, 2025

        Thanks. I will release a new version soon. Does this look correct to you?

        • Rakan Alkhnaini

          •

          Dec 6, 2025

          YOU ARE THE MAN!

          Note: Arabic is fixed in the screenshot. English is not LTR though.

        • Rakan Alkhnaini

          •

          Dec 6, 2025

          And one more thing if you're testing this: when Arabic RTL is supported and working just fine (like your screenshot), sometimes the issue occurs again if the new line/row starts with an English character, it ruins the RTL alignment for this new line.

          • Daniel Nguyen

            Team•

            Dec 8, 2025

            Does this look correct to you? I use the default RTL support from the OS / SDK so I guess it’s the standard.

            • Rakan Alkhnaini

              •

              Dec 8, 2025

              Thanks Daniel for sharing.

              Unfortunately, no, this is still incorrect.

              The content in not aligned properly. It seems the test is “align Right” but it’s left-to-Righ.

              For simplicity, these are test scenarios :

              Test 1: All Arabic

              مرحباً بك! أنا هنا لمساعدتك في تعلم البرمجة وتطوير المواقع بشكل احترافي.

              Test 2: Starts with Arabic, English word in middle

              يمكنني مساعدتك في تعلم Python بكل سهولة ومن الصفر.

              Test 3: Starts with English word, rest is Arabic

              JavaScript هي لغة برمجة قوية تستخدم لتطوير المواقع التفاعلية.

              The test results must be like the photo attached

              To have some context from user perspective, the below is the same test, pasted in Microsoft Word. I do these two thing to fix this:

              1- Alight Right

              2- Right-to-Left Text Direction

              • Daniel Nguyen

                Team•

                Dec 8, 2025

                I see. So test 1 and 2 passes. But it fails the test 3? Turns out this is a tricky problem. There doesn’t seem to be a universal solution for this (at least I haven’t found one yet).

                So my solution was to count number of english words and compare with number of arabic words. But it will still fail for certain edge cases.

                FWIW, ChatGPT (and most other apps) fail test 3 too.

                In this case for example, the third paragraph is incorrect, right?

                But how can we determine if it should be ltr or rtl if it has both english and arabic words?

                • Rakan Alkhnaini

                  •

                  Dec 8, 2025

                  Thanks Daniel for being active and patient, much appreciated.

                  Yeah unfortunately this sometimes can be a little bit tricky.

                  However, tests 1 & 2 can be enough for most of the cases. I always add to my prompt: "ensure to start each line with an Arabic character if there's an English term."

                  Thanks again Daniel 🙏