diff options
authorLeena Miettinen <>2014-04-15 16:49:08 +0200
committerThe Qt Project <>2014-04-16 07:28:00 +0200
commit454ebcac45a170abdc67ac08ea04a4efb8c586ad (patch)
parentfb7da5cc8c13bbf9a134306c1d290d34373687b0 (diff)
Doc: recommend using QLocale for loading translations
Users can choose to use different UI languages and regional settings on their devices. QTranslator::load(const QLocale &) function uses QLocale::uiLanguages() and not to the locale name, which refers to the formatting of dates and numbers. Change-Id: Iec6327dd1e91d913176499b23482d725b9d0a8aa Reviewed-by: Fawzi Mohamed <> Reviewed-by: Oswald Buddenhagen <>
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index 843a6edce1..94c77302dd 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -465,6 +465,12 @@ QTranslator::~QTranslator()
\li \c /opt/foolib/foo.qm
\li \c /opt/foolib/foo
+ Usually, it is better to use the QTranslator::load(const QLocale &,
+ const QString &, const QString &, const QString &, const QString &)
+ function instead, because it uses \l{QLocale::uiLanguages()} and not simply
+ the locale name, which refers to the formatting of dates and numbers and not
+ necessarily the UI language.
bool QTranslator::load(const QString & filename, const QString & directory,