Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt linguist problem with utf8 accent (qml and c++)
Forum Updated to NodeBB v4.3 + New Features

Qt linguist problem with utf8 accent (qml and c++)

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 2 Posters 1.5k 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.
  • P Offline
    P Offline
    pparent
    wrote on last edited by
    #1

    Hi,

    I'm trying to translate an application using qt4.8.2 and qml from french (containing accents) to english.

    I works fine for orginal sentences containing no accent (utf-8 caracters). But for original (french) sentences with accents it simply does not apply translation. The sentences with accents appear fine in qt linquist interface and in the original application. All the source code (c++ and qml) is encoded in utf8 format.

    In c++ I have found a trick that make it work for sentence with accents:

    @//gets correctly translated
    QObject::tr(QObject::trUtf8("éèê").toUtf8());
    //!!! DOES NOT GET TRANSLATED !!!
    QObject::trUtf8("éèê")
    @

    But in QML it's not possible to do anything like that.
    qml:
    @//!! DOES NOT GET TRANSLATED !!
    qsTr("éèê");
    //gets correctly translated
    qsTr("Bonjour");
    @

    Would you have a clue?
    Thank's in advance.

    Pierre.

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

      Hi and welcome to devnet,

      Did you check the "bug report system":http://bugreports.qt-project.org to see whether it's something known ?

      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

      • Login

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