mirror of
https://github.com/GerbilSoft/rvthtool.git
synced 2025-06-18 11:35:33 -04:00
[qrvthtool] TranslationManager: Set LANG and LC_ALL.
This helps a bit with KDE's Open dialog, but the "Cancel" button isn't getting translated for some reason. Similarly, SelectDeviceDialog's "OK" button isn't getting translated, and "Cancel" uses whatever the LC_ALL value was on startup.
This commit is contained in:
parent
4e0f741910
commit
11cfd9cd62
@ -196,6 +196,17 @@ void TranslationManager::setTranslation(const QString &locale)
|
|||||||
//: Locale name, e.g. "en_US".
|
//: Locale name, e.g. "en_US".
|
||||||
QString tsLocale = tr("C", "ts-locale");
|
QString tsLocale = tr("C", "ts-locale");
|
||||||
Q_UNUSED(tsLocale)
|
Q_UNUSED(tsLocale)
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
// Setting LANG and LC_ALL may help with Qt's base translations...
|
||||||
|
tsLocale += QLatin1String(".UTF-8");
|
||||||
|
QByteArray tsLocale_utf8 = tsLocale.toUtf8();
|
||||||
|
setenv("LANG", tsLocale_utf8.constData(), 1);
|
||||||
|
setenv("LC_ALL", tsLocale_utf8.constData(), 1);
|
||||||
|
|
||||||
|
// Reinstall a translator to force Qt to update based on LANG and LC_ALL.
|
||||||
|
qApp->installTranslator(d->prgTranslator);
|
||||||
|
#endif /* __linux__ */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user