[Bug] Every first-time user on earth starts OciDeck in Dutch #572

Closed
opened 2026-07-22 16:15:19 +00:00 by brenno · 1 comment
Owner

Found in the pre-publication review, confirmed live against the web build.

Evidence: lib/state/settings_provider.dart:149prefs.getString('languageCode') ?? 'nl', and lib/models/settings.dart:750this.languageCode = 'nl'. The l10n layer agrees (lib/l10n/app_localizations.dart:250, :258). There are zero uses of PlatformDispatcher.instance.locale anywhere in lib/, so the system locale is never consulted; lib/app.dart:48 pins locale: to the stored setting, so MaterialApp never gets to negotiate either.

What this means in practice: the very first screen is the consent wall — title 'Welkom bij OciDeck' (consent_dialog.dart:83) plus the full PrivacyStatementContent (328 lines, 25 localised calls) — and it renders in Dutch. There is a language picker in the top right, but the user has to find it after being asked to tick a box agreeing to a privacy statement they cannot read.

Why this must be fixed before publication: README.md:42 sells "the interface runs in 32 languages" as a headline feature. Every reviewer who opens the demo gets Dutch, and the obvious write-up is "it is Dutch-only, the 32-language claim is marketing". Separately, consent obtained through a wall in a language the user does not read is exactly the practice this project would criticise in others. The app already has all 32 languages ready; only the initial value points at the Netherlands.

Proposal: one line — prefs.getString('languageCode') ?? _systemLanguageOrEn(), where the helper walks PlatformDispatcher.instance.locales and returns the first code present in AppLocalizations.languageNames, falling back to en (a better guess than nl for an unknown locale). Only the default changes; an explicit user choice still wins. Two tests: unknown system locale yields en, de-DE yields de.

Found in the pre-publication review, confirmed live against the web build. **Evidence:** `lib/state/settings_provider.dart:149` — `prefs.getString('languageCode') ?? 'nl'`, and `lib/models/settings.dart:750` — `this.languageCode = 'nl'`. The l10n layer agrees (`lib/l10n/app_localizations.dart:250`, `:258`). There are zero uses of `PlatformDispatcher.instance.locale` anywhere in `lib/`, so the system locale is never consulted; `lib/app.dart:48` pins `locale:` to the stored setting, so `MaterialApp` never gets to negotiate either. **What this means in practice:** the very first screen is the consent wall — title `'Welkom bij OciDeck'` (`consent_dialog.dart:83`) plus the full `PrivacyStatementContent` (328 lines, 25 localised calls) — and it renders in Dutch. There is a language picker in the top right, but the user has to find it *after* being asked to tick a box agreeing to a privacy statement they cannot read. **Why this must be fixed before publication:** `README.md:42` sells "the interface runs in 32 languages" as a headline feature. Every reviewer who opens the demo gets Dutch, and the obvious write-up is "it is Dutch-only, the 32-language claim is marketing". Separately, consent obtained through a wall in a language the user does not read is exactly the practice this project would criticise in others. The app already has all 32 languages ready; only the initial value points at the Netherlands. **Proposal:** one line — `prefs.getString('languageCode') ?? _systemLanguageOrEn()`, where the helper walks `PlatformDispatcher.instance.locales` and returns the first code present in `AppLocalizations.languageNames`, falling back to `en` (a better guess than `nl` for an unknown locale). Only the *default* changes; an explicit user choice still wins. Two tests: unknown system locale yields `en`, `de-DE` yields `de`.
Author
Owner

Opgelost in `b043d5f` (PR #652).

settings_provider.dart vraagt nu de systeemtaal op via PlatformDispatcher en valt terug op Engels — niet op Nederlands — voor een taal die niet in languageNames staat. Alleen de startwaarde; een opgeslagen keuze wint altijd. De resolutie staat als AppLocalizations.preferredLanguageCode bij de talenlijst waar ze hoort.

Bijvangst die het waard is om te noemen: de wijziging brak 97 widgettests, want die zoeken Nederlandse knopteksten. Dat is opgelost met test/flutter_test_config.dart, dat de starttaal één keer voor de hele suite vastzet. Op een Nederlandse machine was dat nooit opgevallen — de suite hing af van de landinstelling van wie hem draaide.

Opgelost in \`b043d5f\` (PR #652). `settings_provider.dart` vraagt nu de systeemtaal op via `PlatformDispatcher` en valt terug op Engels — niet op Nederlands — voor een taal die niet in `languageNames` staat. Alleen de startwaarde; een opgeslagen keuze wint altijd. De resolutie staat als `AppLocalizations.preferredLanguageCode` bij de talenlijst waar ze hoort. Bijvangst die het waard is om te noemen: de wijziging brak 97 widgettests, want die zoeken Nederlandse knopteksten. Dat is opgelost met `test/flutter_test_config.dart`, dat de starttaal één keer voor de hele suite vastzet. Op een Nederlandse machine was dat nooit opgevallen — de suite hing af van de landinstelling van wie hem draaide.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
LibreKAT/Ocideck#572
No description provided.