<table><tr><td style="">kossebau added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D8351" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p><a href="https://phabricator.kde.org/p/ilic/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;" rel="noreferrer">@ilic</a> ping? Can you confirm this is correct and by design?</p>

<p>Motivation is:<br />
<a href="https://cgit.kde.org/ki18n.git/tree/src/klocalizedstring.cpp#n1257" class="remarkup-link" target="_blank" rel="noreferrer"><tt style="background: #ebebeb; font-size: 13px;">KLocalizedString::setApplicationDomain()</tt></a> triggers the creation of the <tt style="background: #ebebeb; font-size: 13px;">KLocalizedStringPrivateStatics</tt> instance, which then also <a href="https://cgit.kde.org/kxmlgui.git/tree/src/kswitchlanguagedialog_p.cpp#n76" class="remarkup-link" target="_blank" rel="noreferrer">reads the currently set env vars to collect the set locales/languages</a>. <br />
Now KXMLGUI's language switching support for programs injects the override language via <tt style="background: #ebebeb; font-size: 13px;">Q_COREAPP_STARTUP_FUNCTION(initializeLanguages)</tt> (see <a href="https://cgit.kde.org/kxmlgui.git/tree/src/kswitchlanguagedialog_p.cpp#n44" class="remarkup-link" target="_blank" rel="noreferrer">kswitchlanguagedialog_p.cpp</a> lines 44ff) by twisting the <tt style="background: #ebebeb; font-size: 13px;">LANGUAGE</tt> env var.<br />
So for that to work, the <tt style="background: #ebebeb; font-size: 13px;">KLocalizedStringPrivateStatics</tt> instance has to be created only _after_ the QCoreApplication constructor is run.</p>

<p>A few programs had the order reversed, due to calling <tt style="background: #ebebeb; font-size: 13px;">KLocalizedString::setApplicationDomain()</tt> before QApp creation, resulting in the language switching override being ignored and thus broken.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R249 KI18n</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D8351" rel="noreferrer">https://phabricator.kde.org/D8351</a></div></div><br /><div><strong>To: </strong>kossebau, Frameworks, ilic, ltoscano<br /></div>