Skip to content

Take the host's theme and language on every screen - #16

Merged
mpge merged 3 commits into
mainfrom
fix/host-theme-and-l10n
Sep 27, 2026
Merged

mpge merged 3 commits into
mainfrom
fix/host-theme-and-l10n

Conversation

@mpge

@mpge mpge commented Sep 27, 2026

Copy link
Copy Markdown
Member

Inside host apps the ticket screens were off-brand and partly English: a pale aqua new-ticket button (Material 3's primaryContainer), indigo references and links, and "Failed to load tickets." inside a French UI.

Theme -- every screen and widget reads the app's ThemeData: primary, the surface/surfaceContainer* tones, onSurface/onSurfaceVariant, outlineVariant, error/onError. The new-ticket button uses the host's floatingActionButtonTheme, else primary/onPrimary. Status, priority and SLA badges keep their fixed meaning colours. No isDark ? AppColors.x : AppColors.y left in screens or widgets.

Language

  • Providers record a translation key (failed_to_load_tickets, unexpected_error, ...) instead of English; a server's own message is kept only for a request it refused (4xx). Error views and the auth screens translate what they are given; AppLocalizations.t passes non-key text through.
  • New keys in en/fr/es/de, plus a fr_CA table that overrides fr where Canadian usage differs (courriel). Lookup: region, then language, then English.
  • Remaining literals translated (field required, None, SLA, create failure); dates use the app locale (intl yMMMd) instead of fixed English formats.

Build -- holds html below 0.15.7: flutter_html 3.0.0 does not compile against it, and the package resolved it, so nothing importing ReplyThread built. No test imported a screen until now.

Verification -- flutter analyze: no issues (was 91 infos). flutter test: 21 passed, including widget tests for a French load failure, FAB and reference colours under a teal host theme, a host FAB theme winning, and French dates. README documents theming and localization.

flutter_html 3.0.0 calls a query-selector function html 0.15.7 removed.
The package resolved 0.15.7, so anything importing ReplyThread failed to
compile; no test imported a screen, so CI never saw it. Hosts already pin
0.15.6 by hand.

Also clears the analyzer's remaining infos in these files (null-aware map
entries, the redundant library name).
Providers stored fixed English errors ("Failed to load tickets."), which
French and Spanish apps showed as they were. They now record a translation
key, and keep a server's own message only for a request it refused (4xx);
a 5xx body or a missing response gets the key.

AppLocalizations looks a key up in the regional table first (fr_CA, which
overrides fr where Canadian usage differs), then the language, then
English, and passes text that is not a key through unchanged. Adds tf()
for placeholders and locale-aware date helpers.
The ticket screens were off-brand inside host apps: the new-ticket button
came out in Material 3's pale primaryContainer, references and links in a
fixed indigo, and surfaces, text and borders in Escalated's own greys. They
now read the app's ThemeData throughout -- primary, surface tones,
onSurface/onSurfaceVariant, outlineVariant, error -- and the button uses
the host's FAB theme, else its primary. Status, priority and SLA badges
keep their meaning colours.

Remaining English strings (field-required, None, SLA, the create-ticket
failure) are translated, error views translate the provider's key, and
dates follow the app locale instead of always formatting in English.

The same colour change applies to the auth, knowledge-base, guest and
settings screens.
@mpge
mpge merged commit dd17128 into main Sep 27, 2026
1 check passed
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.

1 participant