Adding en_AU and en_GB locales to resolve #2500
* Adjusted main.cpp to accomodate the full locale name
This commit is contained in:
parent
fd4db35940
commit
9147e65963
4 changed files with 2582 additions and 17 deletions
14
OpenRGB.pro
14
OpenRGB.pro
|
|
@ -1159,12 +1159,14 @@ contains(QMAKE_PLATFORM, freebsd) {
|
|||
RESOURCES += \
|
||||
qt/resources.qrc \
|
||||
|
||||
TRANSLATIONS += \
|
||||
qt/i18n/OpenRGB_en.ts \
|
||||
qt/i18n/OpenRGB_de.ts \
|
||||
qt/i18n/OpenRGB_es.ts \
|
||||
qt/i18n/OpenRGB_fr.ts \
|
||||
qt/i18n/OpenRGB_ru.ts \
|
||||
TRANSLATIONS += \
|
||||
qt/i18n/OpenRGB_en.ts \
|
||||
qt/i18n/OpenRGB_en_AU.ts \
|
||||
qt/i18n/OpenRGB_en_GB.ts \
|
||||
qt/i18n/OpenRGB_de.ts \
|
||||
qt/i18n/OpenRGB_es.ts \
|
||||
qt/i18n/OpenRGB_fr.ts \
|
||||
qt/i18n/OpenRGB_ru.ts \
|
||||
|
||||
FORMS += \
|
||||
qt/OpenRGBClientInfoPage.ui \
|
||||
|
|
|
|||
17
main.cpp
17
main.cpp
|
|
@ -356,29 +356,24 @@ int main(int argc, char* argv[])
|
|||
\*---------------------------------------------------------*/
|
||||
QTranslator translator;
|
||||
|
||||
QString defaultLocale = QLocale::system().name();
|
||||
defaultLocale.truncate(defaultLocale.lastIndexOf('_'));
|
||||
|
||||
// For local tests without changing the PC locale, override this value.
|
||||
//defaultLocale="fr";
|
||||
|
||||
QLocale locale = QLocale(defaultLocale);
|
||||
QLocale locale = QLocale(QLocale::system());
|
||||
QLocale::setDefault(locale);
|
||||
|
||||
QString languageName = QLocale::languageToString(locale.language());
|
||||
// For local tests without changing the PC locale, override this value.
|
||||
//locale = QLocale(QLocale::French, QLocale::France);
|
||||
|
||||
a.removeTranslator(&translator);
|
||||
|
||||
QString path = ":/i18n/";
|
||||
|
||||
if(translator.load(path + QString("OpenRGB_%1.qm").arg(defaultLocale)))
|
||||
if(translator.load(path + QString("OpenRGB_%1.qm").arg(locale.name())))
|
||||
{
|
||||
a.installTranslator(&translator);
|
||||
printf("Current Language changed to %s\n", languageName.toStdString().c_str());
|
||||
printf("Current Language changed to %s\n", locale.name().toStdString().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Failed to load translation file for default locale '%s'\n", defaultLocale.toStdString().c_str());
|
||||
printf("Failed to load translation file for default locale '%s'\n", locale.name().toStdString().c_str());
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
|
|
|
|||
1284
qt/i18n/OpenRGB_en_AU.ts
Normal file
1284
qt/i18n/OpenRGB_en_AU.ts
Normal file
File diff suppressed because it is too large
Load diff
1284
qt/i18n/OpenRGB_en_GB.ts
Normal file
1284
qt/i18n/OpenRGB_en_GB.ts
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue