Skip to content

Fix app using a wrong language with some local versions of language - #4733

Open
xkello wants to merge 1 commit into
masterfrom
bugfix/fix-local-languages-bug
Open

xkello wants to merge 1 commit into
masterfrom
bugfix/fix-local-languages-bug

Conversation

@xkello

@xkello xkello commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Description

Some users saw the app switch to an unexpected language, for example Slovak, even though their device preferred English. This depended on which languages were configured on the device and in what order.

Fixes: #4524

What changed

main.cpp now resolves the preferred language through a new loadInputTranslation function instead of a single QTranslator load call. It walks through the device's preferred languages one at a time and, for each one, tries every listed form as well as a manually built base form (for example plain en derived from en_GB) before moving on to the next preferred language. This matters because Qt's own uiLanguages() list can place a preferred language's base form behind an exact match for a less preferred one, which is what caused the wrong language to get picked before.

Behavior

Users should now consistently see the app in their actual top preferred language. Switching the device language back and forth, or having a secondary language configured alongside the primary one, no longer risks the app settling on an unrelated language.

@xkello
xkello requested a review from Withalion September 30, 2026 14:28
@github-actions

Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 73461 dmg Expires: 29/12/2026 #7346
linux Build ❌ Build failed or not found. #7372
win64 Build 📬 Mergin Maps 65481 win64 Expires: 29/12/2026 #6548
Android Build 📬 Mergin Maps 865811 APK [armeabi-v7a] Expires: 29/12/2026 #8658
📬 QR code Google Play Store #8658
Android Build 📬 Mergin Maps 865851 APK [arm64-v8a] Expires: 29/12/2026 #8658
📬 QR code Google Play Store #8658
iOS Build 📬 Build number: 26.09.959811 #9598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Application sometimes chooses wrong language, when using local versions of language

1 participant