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

Add a snippet in the documentation for the use of the parameter n in qsTr()

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Fixed
    • Icon: P3: Somewhat important P3: Somewhat important
    • 6.8.1, 6.9.0 FF
    • 6.7
    • Documentation
    • c612dc3d1 (dev), 1863fd82c (6.8)
    • DaVinci 103, DaVinci 104, DaVinci 105

      link: https://doc.qt.io/qt-6/qml-qtqml-qt.html#qsTr-method

      The documentation explains 

      value of n for strings containing plurals 

      but this is not clear how n is supposed to be used. Especially when you see the explanation of n in qsTrId()'s documentation. (Does n mean the same as for qsTrId()?)

      If n >= 0, all occurrences of %n in the resulting string are replaced with a decimal representation of n. In addition, depending on n's value, the translation text may vary. 

      Adding an example snippet to the documentation should make the usage of n clearer.

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

            andreas.eliasson Andreas Eliasson
            mikio_hirai Mikio Hirai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes