6#include <emscripten/val.h>
13#ifndef QT_NO_SYSTEMLOCALE
17QStringList navigatorLanguages()
19 using emscripten::val;
20 const val navigator = val::global(
"navigator");
21 const auto languages = emscripten::vecFromJSArray<std::string>(navigator[
"languages"]);
22 QStringList qtLanguages;
23 for (
const std::string& language : languages)
24 qtLanguages.append(QString::fromStdString(language));
30QVariant QSystemLocale::query(QueryType query, QVariant &&in)
const
35 case QSystemLocale::UILanguages:
36 return QVariant(navigatorLanguages());
44QLocale QSystemLocale::fallbackLocale()
const
46 const QStringList languages = navigatorLanguages();
47 if (languages.isEmpty())
48 return QLocale(u"en-US");
49 return QLocale(languages[0]);