Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Supporting Right to Left Languages
Qt 6.11 is out! See what's new in the release blog

Supporting Right to Left Languages

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kumararajas
    wrote on last edited by
    #1

    Hello!
    I have a question around the support of right to left languages.
    In my application, we are going to start the support for right to left languages.

    I know that, for right to left languages, we need to do layout mirroring.

    At this point of time, we are not thinking about layout mirroring. The reason is that, in our application, we have the huge block of legacy code, UI screens, which are implemented in a custom way, without using Qt.

    So, to extend the support for right to left languages, we are thinking to do in a simple way. That is just translate the texts that are being displayed.

    Example:
    Assume that the text displayed is
    @HELLO@

    And the translation for the above text in Arabic is
    @مرحبا@

    Another example
    Label displayed in UI: @Save@

    After the changing the language to Arabic: @حفظ@

    I am thinking that text alignment is not playing a big role here. Just applying the translation should do the job.
    Is my understanding correct? Please help me out.

    Thanks a ton,
    Kumar

    --Kumar

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      IIRC you don't need to do anything special for your layout, Qt already supports right to left UI.

      You can use QApplication::setLayoutDirection if you want to force left to right or right to left layouts.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kumararajas
        wrote on last edited by
        #3

        Thanks for your response Samuel :)
        It helps me to some extent. But still there is a problem.

        As I said in the post, the some part of application is developed in custom way, meaning Ui is not developed using Qt.

        So, if we do QApplication::setLayoutDirection(,,,), its going to change the layout of the screens which are developed using Qt. And not for the screen which are developed not using Qt.

        So, we thought not to change the layout direction. Instead we want to just translate the text.

        Am also clear on how to use the Qt translation. But, am bit confused on the part of text alignment. Do we need to do anything special for text alignment if am not going to use setLayoutDirection?

        Please let me know if am not clear in any place.

        Thanks,
        Kumar

        --Kumar

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          AFAIK, no you don't need to do anything special for the textual part.

          But you really should consider supporting the layout direction. It will probably look surprising to your user to have a right to left text in a left to right layout.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kumararajas
            wrote on last edited by
            #5

            Thank you for the response Samuel!

            --Kumar

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved