22 #include <QApplication>
24 #include <QLibraryInfo>
26 #include <QMutexLocker>
28 #include <QTranslator>
41 QMutexLocker locker{&
lock};
54 QString locale = localeName.isEmpty() ? QLocale::system().name().section(
'_', 0, 0) : localeName;
57 qDebug() <<
"Loaded translation" << locale;
60 QString s_locale =
"qt_" + locale;
61 QString location = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
64 qDebug() <<
"System translation loaded" << locale;
66 qDebug() <<
"System translation not loaded" << locale;
72 qDebug() <<
"Error loading translation" << locale;
77 const QString direction =
78 QApplication::tr(
"LTR",
"Translate this string to the string 'RTL' in"
79 " right-to-left languages (for example Hebrew and"
80 " Arabic) to get proper widget layout");
82 QGuiApplication::setLayoutDirection(direction ==
"RTL" ? Qt::RightToLeft : Qt::LeftToRight);
95 QMutexLocker locker{&
lock};
105 QMutexLocker locker{&
lock};
107 [=](
const Callback& c) {
return c.first == owner; }),