Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64840

Make QString bidi aware when joining

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.9.2
    • None

    Description

      So before starting, here a small story:
      I am a programmer that wrote a nice error message for the user, saying "The folder %1 doesn't exist", and let my translator translate it.
      My Arabic translator did that and produced a nice string. So now my error is shown to Arab people, but contains a problem: The direction of the folder name is not right.
      "The folder /home/user/test_ doesn't exist", which is translated to:
      ‫"المجلد /home/user/test_ غير موجود"
      (I added a RLE to make it look right in JIRA).
      Note how the text is formatted wrongly, and that's because a strong RTL character forced the direction.

      This is a suggestion for adding a function to QString that would return the string “bidi aware”, so even Arabic files like
      ‫سطح المكتب_
      will look like that in English strings, and not "سطح المكتب_".

      We faced such a problem in Konversation (KDE) and PCManFM-Qt (LXQt), where there are different strings with different directions being joined to one string.

      Here you can see the way it was done in Konvesation (formatFinalLine function). And here the way in PCManFM (which was much easier).

      Another approach will be modifying `arg` functions, adding a new parameter for returning the string “bidi aware”, but this will require changing a bunch of overloads.

      Any comment or suggestion is appreciated.
      Thanks for reading!

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              thiago Thiago Macieira
              safa alfulaij Safa Alfulaij
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes