Language translation
-
Hello,
As per my requirement, i need to translate the entire text in all the screens to the selected language whenever user changes the language settings.
Can someone help me in how to implement this Qt quick application? -
A good place to start is "here.":http://qt-project.org/doc/qt-4.8/qdeclarativei18n.html And "here.":http://qt-project.org/doc/qt-4.8/internationalization.html
-
Not forgetting "bug":https://bugreports.qt-project.org/browse/QTBUG-15602 which means that QML doesn't handle true dynamic translations well. There are some work arounds but they're not very pretty.
-
Here is one of them:
"workaround":http://qt-project.org/wiki/How_to_do_dynamic_translation_in_QML -
Thank u guys....
Can someone please share any sample code....i.e. depending on some condition the QML Text Element in Rectangles has to be changed to a different language.
Is it possible without using C++ and by using only QML? -
The links that @Rocken and @mlong gave have pretty complete examples of what you need to do. I would suggest reading those and following links through the wiki / help to find out what you need.
You can do most of what you need in QML, but the functionality to load and set the translators will need to be in C++. See the documentation for "QTranslator":http://qt-project.org/doc/qt-4.8/qtranslator.html for help on this.