Changeset View
Changeset View
Standalone View
Standalone View
src/main.cpp
Show All 36 Lines | |||||
37 | static void load() | 37 | static void load() | ||
38 | { | 38 | { | ||
39 | // The way Qt translation system handles plural forms makes it necessary to | 39 | // The way Qt translation system handles plural forms makes it necessary to | ||
40 | // have a translation file which contains only plural forms for `en`. That's | 40 | // have a translation file which contains only plural forms for `en`. That's | ||
41 | // why we load the `en` translation unconditionally, then load the | 41 | // why we load the `en` translation unconditionally, then load the | ||
42 | // translation for the current locale to overload it. | 42 | // translation for the current locale to overload it. | ||
43 | loadTranslation(QStringLiteral("en")); | 43 | loadTranslation(QStringLiteral("en")); | ||
44 | 44 | | |||
45 | QLocale locale = QLocale::system(); | 45 | QLocale locale; | ||
46 | if (locale.name() != QStringLiteral("en")) { | 46 | if (locale.name() != QStringLiteral("en")) { | ||
47 | if (!loadTranslation(locale.name())) { | 47 | if (!loadTranslation(locale.name())) { | ||
48 | loadTranslation(locale.bcp47Name()); | 48 | loadTranslation(locale.bcp47Name()); | ||
49 | } | 49 | } | ||
50 | } | 50 | } | ||
51 | } | 51 | } | ||
52 | 52 | | |||
53 | Q_COREAPP_STARTUP_FUNCTION(load) | 53 | Q_COREAPP_STARTUP_FUNCTION(load) |