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. Strange language issue
QtWS25 Last Chance

Strange language issue

Scheduled Pinned Locked Moved Unsolved General and Desktop
language qt
8 Posts 2 Posters 2.7k Views
  • 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
    krobinson
    wrote on last edited by
    #1

    I am currently developing a qt application and I am having a strange language issue. I am using a message handler to write messages out to a log file. The issue is that some of the debug messages are in German and I am not sure why. This only happens when I release the application and not in debug. Also if I delete the translations directory it defaults back to English. Here is some of the code.

    qInstallMessageHandler(messageHandler);
    
    void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
    {
        switch (type)
        {
            case QtCriticalMsg:
            case QtFatalMsg:
                LogManager::writeError(QString("%1 (%2:%3, %4)").arg(msg.toLocal8Bit().constData(), context.file, QString::number(context.line), context.function));
                if(type == QtFatalMsg)
                    abort();
                break;
            default: //QtDebugMsg || QtWarningMsg
                LogManager::writeDebug((msg + "\r\n").toLocal8Bit().constData() );
                break;
        }
    }
    

    Here is an example of the output I am seeing

    2016-03-02 14:04:22 Debug - qrc:/Qml/SettingsPage.qml:459:13: QML Image: Binding loop detected for property "sourceSize.height"
    2016-03-02 14:04:22 Debug - qrc:/Qml/DiagnosticPane.qml:38: TypeError: Cannot call method 'getDiagnosticsInfo' of null
    2016-03-02 14:04:22 Debug - qrc:/Qml/Controls/PopupSlider.qml:50:22: Unable to assign null to QQuickAnchorLine
    2016-03-02 14:04:22 Debug - qrc:/Qml/Controls/PopupSlider.qml:50:22: Unable to assign null to QQuickAnchorLine
    2016-03-02 14:04:22 Debug - qrc:/Qml/Controls/PopupSlider.qml:50:22: Unable to assign null to QQuickAnchorLine
    2016-03-02 14:04:22 Debug - <Unknown File>: QML QQuickLayoutAttached: Binding loop detected for property "preferredWidth"
    2016-03-02 14:04:22 Debug - <Unknown File>: QML QQuickLayoutAttached: Binding loop detected for property "preferredWidth"
    2016-03-02 14:04:22 Debug - qrc:/Qml/SettingsPage.qml:454:9: QML ColumnLayout: Bei der Operation 'centerIn' wurde eine potentielle Endlosschleife der Anker festgestellt.
    

    Notice the last one is in German.

    Any ideas what is going on here?

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

      Hi,

      Since you wrote about deleting the translations directory, do you handle internationalization in your application ?

      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
        krobinson
        wrote on last edited by
        #3

        No, not yet. The translations were included because they were outputted from the windeployqt tool. It seems like somehow its defaulting to German, but im not sure why. Should the language match the system language unless it is manually set?

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

          Is your system running in german ?

          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
            krobinson
            wrote on last edited by
            #5

            No, it is in English.

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

              Do you live in a german speaking country ?

              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
                krobinson
                wrote on last edited by
                #7

                Nope, I live in the US. It is happening on all the machines I have tested it on. I also noticed that the buttons on the message boxes are in German as well. I'm not sure where it is getting German from, there should be nothing German related on any of the machines using the software.

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

                  Do you have a qt_en.qm file in your application folder ?

                  If so, remove it.

                  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