Merge pull request #8081 from nextcloud/bugfix/translations-again

set `CFBundleDevelopmentRegion` to `"en"` and set `CFBundleAllowMixedLocalizations`
This commit is contained in:
Matthieu Gallien 2025-03-26 18:27:34 +01:00 committed by GitHub
commit d4ffe5da5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 7 deletions

View File

@ -3,13 +3,15 @@
<plist version="1.0">
<dict>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSMinimumSystemVersion</key>
<string>NSApplication</string>
<key>LSMinimumSystemVersion</key>
<string>11.0</string>
<key>LSUIElement</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>LSUIElement</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleAllowMixedLocalizations</key>
<true/>
<key>CFBundleExecutable</key>
<string>@APPLICATION_NAME@</string>
<key>CFBundleIconFile</key>
@ -29,7 +31,7 @@
<key>CFBundleShortVersionString</key>
<string>@MIRALL_VERSION_STRING@</string>
<key>NSHumanReadableCopyright</key>
<string>(C) 2014-2024 @APPLICATION_VENDOR_XML_ESCAPED@</string>
<string>(C) 2014-2025 @APPLICATION_VENDOR_XML_ESCAPED@</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>NSRequiresAquaSystemAppearance</key>

View File

@ -1003,8 +1003,10 @@ QString substLang(const QString &lang)
void Application::setupTranslations()
{
qCInfo(lcApplication) << "System UI languages are:" << QLocale::system().uiLanguages();
const auto enforcedLocale = Theme::instance()->enforcedLocale();
const auto lang = substLang(!enforcedLocale.isEmpty() ? enforcedLocale : QLocale::system().uiLanguages(QLocale::TagSeparator::Underscore).first());
qCInfo(lcApplication) << "selected application language:" << lang;
auto *translator = new QTranslator(this);
auto *qtTranslator = new QTranslator(this);