Class that stores QTranslator objects for the duration of application execution.
More...
#include <TranslatorContainer.h>
|
static QString | qmDirectory () |
| Platform dependent directory containing qm translation files. More...
|
|
Class that stores QTranslator objects for the duration of application execution.
Definition at line 10 of file TranslatorContainer.h.
TranslatorContainer::TranslatorContainer |
( |
QApplication & |
app | ) |
|
Single constructor. Argument is needed so object is not optimized away in main() in Windows.
Definition at line 9 of file TranslatorContainer.cpp.
11 QLocale localeDefault;
18 QVariant (localeDefault.language())).toInt());
20 QVariant (localeDefault.country())).toInt());
21 QLocale locale (language,
30 if ((localeDefault.name().toLower() !=
"en_us") ||
31 (localeDefault.name().toLower() != locale.name().toLower())) {
33 QString localeName = locale.name().toLower();
36 m_translatorGeneric =
new QTranslator;
37 m_translatorGeneric->load (
"qt_" + localeName,
38 QLibraryInfo::location (QLibraryInfo::TranslationsPath));
39 QApplication::installTranslator (m_translatorGeneric);
46 QString delimiters (
"._");
47 m_translatorEngauge =
new QTranslator;
49 bool rtn = m_translatorEngauge->load (
"engauge_" + localeName,
54 QString localeNameUpper = QString (
"%1%2")
55 .arg (localeName.left (localeName.length() - 2))
56 .arg (localeName.right (2).toUpper ());
57 m_translatorEngauge->load (
"engauge_" + localeNameUpper,
61 QApplication::installTranslator (m_translatorEngauge);
const QString SETTINGS_DIGITIZER
const QString SETTINGS_LOCALE_LANGUAGE
const QString SETTINGS_LOCALE_COUNTRY
const QString SETTINGS_ENGAUGE
const QString SETTINGS_GROUP_MAIN_WINDOW
static QString qmDirectory()
Platform dependent directory containing qm translation files.
QString TranslatorContainer::qmDirectory |
( |
| ) |
|
|
static |
Platform dependent directory containing qm translation files.
Definition at line 65 of file TranslatorContainer.cpp.
67 #if defined(OSX_DEBUG) || defined(OSX_RELEASE)
68 return QCoreApplication::applicationDirPath () +
"/../Resources/translations";
70 return QCoreApplication::applicationDirPath () +
"/translations";
The documentation for this class was generated from the following files: