5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef TRANSLATIONS_H
22 #define TRANSLATIONS_H
26 // Where to find translation files?
27 // First any path in environment variable OPENTX_APP_TRANSLATIONS_PATH is used if it exists.
29 // Default location for .qm files when NOT compiled into application (this is searched after OPENTX_APP_TRANSLATIONS_PATH).
30 #ifndef APP_TRANSLATIONS_FILE_PATH
31 #define APP_TRANSLATIONS_FILE_PATH QCoreApplication::applicationDirPath() % "/translations"
34 // Default location for .qm files when compiled into application as a resource (this is searched after APP_TRANSLATIONS_FILE_PATH) .
35 #ifndef APP_TRANSLATIONS_RESOURCE_PATH
36 #define APP_TRANSLATIONS_RESOURCE_PATH ":/translations"
45 static QStringList
const getTranslationPaths();
46 static QStringList
const getAvailableTranslations();
47 static QStringList
const getAvailableLanguages();
49 static void installTranslators();
52 static bool tryLoadTranslator(QTranslator
* t
, const QLocale
& locale
, const QString
& baseFile
, const QStringList
& paths
);
55 #endif // TRANSLATIONS_H