Hi, I have the following code (part of a small project) which is being built both as a standalone executable and a wasm web application.
They both work except the locale determination. On my Linux console, I can set the LANGUAGE environment to de and the executable will load the correct labels However, when I run it wasm web app and connect to it via a German language OS web browser, it keeps thinking that the locale is still "C" and not "de_DE" I am new to locale handling in general and definitely new to locale on the web browser. I am developing with Qt 5.14.0 Code =================== #include <QApplication> #include <QPushButton> #include <QTranslator> #include <QLocale> #include <iostream> #include "CMEForm.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); QTranslator translator; std::cout << "Locale is " << QLocale::system().name().toStdString() << std::endl; if (QLocale::system().name().startsWith("de_")) { if (translator.load(":/language/.qm/cme_de.qm")) { app.installTranslator(&translator); } else { std::cerr << "ERROR: Translation failure to load" << std::endl; } } CMEForm cme; cme.show(); return app.exec(); } -- Nicholas Yue Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5 Custom Dev - C++ porting, OSX, Linux, Windows http://au.linkedin.com/in/nicholasyue https://vimeo.com/channels/naiadtools
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest