Files
2026-02-18 01:31:41 +01:00

3.8 KiB

phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, duration, completed
phase plan subsystem tags requires provides affects tech-stack key-files key-decisions patterns-established duration completed
15-locale-detection-routing 03 ui
locale
i18n
cookies
accept-language
account-settings
phase provides
15-01 preferred_locale field on User model, LocaleMiddleware detection
Language preference section in account settings
LocaleSuggestionBanner component for browser language detection
Dismissible banner with cookie persistence
user-experience
theme
added patterns
browser-locale-detection
dismissal-cookie-pattern
created modified
plugins/golem15/translate/components/LocaleSuggestionBanner.php
plugins/golem15/translate/components/localesuggestionbanner/default.htm
themes/quotify/assets/css/components/locale-banner.css
themes/quotify/partials/account/update.htm
themes/quotify/layouts/default.htm
themes/quotify/assets/css/app.css
plugins/golem15/translate/Plugin.php
Banner shows localized text in target language (e.g., 'Diese Seite ist auf Deutsch verfugbar')
1-week dismissal cookie (10080 minutes) prevents banner showing repeatedly
Banner respects locale_manually_set cookie from LocalePicker
Accept-Language parsing: extract 2-char code, match against enabled locales
Dismissal pattern: session flag + persistent cookie for multi-session
2min 2026-02-02

Phase 15 Plan 03: Language Preferences & Suggestion Banner Summary

Account settings language preference dropdown and LocaleSuggestionBanner component with Accept-Language detection and dismissible UI

Performance

  • Duration: 2 min
  • Started: 2026-02-02T01:06:50Z
  • Completed: 2026-02-02T01:09:02Z
  • Tasks: 3
  • Files modified: 7

Accomplishments

  • Added Language Preference section to account settings with en/pl/de dropdown
  • Created LocaleSuggestionBanner component with browser language detection
  • Implemented dismissal cookie and manual selection cookie integration
  • Added responsive sticky banner CSS with gradient styling

Task Commits

Each task was committed atomically:

  1. Task 1: Add language preference section to account settings - 652b035 (feat) [theme]
  2. Task 2: Create LocaleSuggestionBanner component - 8f8885f (feat) [translate plugin]
  3. Task 3: Add banner CSS and integrate into layout - 006987e (feat) [theme]

Submodule update: 82796d1 (feat: submodule pointer update)

Files Created/Modified

Created:

  • plugins/golem15/translate/components/LocaleSuggestionBanner.php - Component with browser detection
  • plugins/golem15/translate/components/localesuggestionbanner/default.htm - Banner partial
  • themes/quotify/assets/css/components/locale-banner.css - Banner styles

Modified:

  • themes/quotify/partials/account/update.htm - Added Language Preference section
  • themes/quotify/layouts/default.htm - Registered and rendered banner component
  • themes/quotify/assets/css/app.css - Imported locale-banner.css
  • plugins/golem15/translate/Plugin.php - Registered LocaleSuggestionBanner component

Decisions Made

  • Banner shows localized text in the suggested language (Polish/German) rather than current page language
  • Uses 1-week dismissal cookie to prevent annoyance while still showing eventually
  • Banner appears after flash messages, before page-wrapper for maximum visibility

Deviations from Plan

None - plan executed exactly as written.

Issues Encountered

None.

User Setup Required

None - no external service configuration required.

Next Phase Readiness

  • Language preferences fully functional for logged-in users
  • Browser language detection and suggestion banner working
  • Ready for Phase 15-04 (Auto-redirect Strategy) if planned

Phase: 15-locale-detection-routing Completed: 2026-02-02