Commit 5aa1aea6 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Attempt to fix UI translations broken.

CCBUG: 424967
parent 66fdf2e0
...@@ -23,10 +23,10 @@ auto LocaleHandling::setLocale(const QString &lcName) -> QString ...@@ -23,10 +23,10 @@ auto LocaleHandling::setLocale(const QString &lcName) -> QString
#ifdef Q_OS_FREEBSD #ifdef Q_OS_FREEBSD
auto *result = setlocale(LC_ALL, locale.toStdString().c_str()); auto *result = setlocale(LC_ALL, locale.toStdString().c_str());
#else #else
auto *result = std::setlocale(LC_ALL, locale.toStdString().c_str()); auto *result = std::setlocale(LC_NUMERIC, locale.toStdString().c_str());
#endif #endif
if (result != nullptr) { if (result != nullptr) {
::qputenv("LC_ALL", locale.toStdString().c_str()); ::qputenv("LC_NUMERIC", locale.toStdString().c_str());
newLocale = locale; newLocale = locale;
break; break;
} }
...@@ -40,12 +40,12 @@ auto LocaleHandling::setLocale(const QString &lcName) -> QString ...@@ -40,12 +40,12 @@ auto LocaleHandling::setLocale(const QString &lcName) -> QString
void LocaleHandling::resetLocale() void LocaleHandling::resetLocale()
{ {
#ifdef Q_OS_FREEBSD #ifdef Q_OS_FREEBSD
setlocale(LC_ALL, "C"); setlocale(LC_NUMERIC, "C");
#else #else
std::setlocale(LC_ALL, "C"); std::setlocale(LC_NUMERIC, "C");
#endif #endif
::qputenv("LC_ALL", "C"); ::qputenv("LC_NUMERIC", "C");
qDebug() << "LC_ALL reset to C"; qDebug() << "LC_NUMERIC reset to C";
} }
QPair<QLocale, LocaleHandling::MatchType> LocaleHandling::getQLocaleForDecimalPoint(const QString &requestedLocale, const QString &decimalPoint) QPair<QLocale, LocaleHandling::MatchType> LocaleHandling::getQLocaleForDecimalPoint(const QString &requestedLocale, const QString &decimalPoint)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment