0

I am trying to develop a Qml based QT application which will support multiple languages.In the application there will be drop down list from where on select of language whole language family of the application will be changed.Can anyone help me on that giving idea how to proceed?

Is there any example? and is QTranslator() is the convenient way to do this?

2 Answers2

2

The localization system of Qt is well documented: Internationalization with Qt

Simply you put your text directly in the C++ code, using the tr() method of QObject (or qsTr() in QML). Than there are some tools (lupdate and lrelease) to generate the translation files. I suggest to read the documentation, it's very easy.

Some useful links:

Fabio
  • 2,522
  • 1
  • 15
  • 25
1

QTranslator works well with Qt UI as you can use languageChanged() signal to update the UI. This isn't possible with QML.

See this QML WiKi, it is the recommended workaround (for now!).

ramtheconqueror
  • 1,907
  • 1
  • 22
  • 35