tractatus/public
TheFlow c16cea80c8 feat(i18n): enhance browser language detection with clear priority logging
SUMMARY:
Enhanced i18n language detection to clearly show priority order and
provide better logging for debugging user language preferences.

PRIORITY ORDER:
1. User's manual selection (localStorage) - HIGHEST
   - Clicking language flags saves preference here
   - Allows users to override browser language

2. Browser's language setting (navigator.language) - AUTOMATIC
   - Detects from browser preferences
   - Only applies if no user override exists

3. Default to English (fallback)
   - Used when browser language not supported

CHANGES:

1. Enhanced detectLanguage():
   - Added clear comments documenting priority order
   - Added console.log for each detection path
   - Shows which source determined the language
   - Logs browser language even when not supported

2. Enhanced setLanguage():
   - Added log when user manually selects language
   - Clarifies that preference overrides browser detection
   - Shows that preference persists across pages

BENEFITS:
✓ Users see automatic language detection from browser
✓ Users can override via flag clicks (persists via localStorage)
✓ Clear logging helps debug language selection issues
✓ Developers can see exactly how language was determined

EXAMPLE LOGS:
- Browser detection: '[i18n] Language detected from browser: de (from de-DE)'
- User override: '[i18n] User manually selected language: fr (saved to localStorage)'
- Fallback: '[i18n] Language defaulted to: en (browser language 'ja-JP' not supported)'

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 15:01:14 +13:00
..
.well-known security: comprehensive security audit and hardening 2025-10-10 05:34:40 +13:00
about style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
admin style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
css fix(a11y): improve link contrast ratio for WCAG AA compliance 2025-10-19 13:54:23 +13:00
demos style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
downloads docs: regenerate PDFs and update documentation metadata 2025-10-14 10:53:48 +13:00
fonts fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
images fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
js feat(i18n): enhance browser language detection with clear priority logging 2025-10-19 15:01:14 +13:00
koha fix(a11y): improve text contrast on koha transparency page 2025-10-19 14:07:38 +13:00
locales fix(i18n): resolve footer translation keys showing on non-homepage pages 2025-10-19 14:49:17 +13:00
about.html fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
api-reference.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
architecture.html fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
blog-post.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
blog.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
case-submission.html fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
check-version.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
docs-viewer.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
docs.html perf(docs): fix CLS and improve accessibility across pages 2025-10-19 14:04:33 +13:00
faq.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
favicon-new.svg fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
favicon.ico feat: implement Rule Manager and Project Manager admin systems 2025-10-11 17:16:51 +13:00
favicon.svg feat: comprehensive documentation improvements and GitHub integration 2025-10-09 14:33:14 +13:00
implementer.html perf(docs): fix CLS and improve accessibility across pages 2025-10-19 14:04:33 +13:00
index.html fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
koha.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
leader.html perf(docs): fix CLS and improve accessibility across pages 2025-10-19 14:04:33 +13:00
manifest.json style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
media-inquiry.html fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
media-triage-transparency.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
privacy.html fix(i18n): add cache-busting version strings to privacy page scripts 2025-10-19 14:56:25 +13:00
researcher.html fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
service-worker.js style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
version.json style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00