Skip to content

Feat: translate web interface based on selected language (FR/EN)#8

Closed
Dcomp-commits wants to merge 2 commits into
psykokwak-com:masterfrom
Dcomp-commits:feature/i18n
Closed

Feat: translate web interface based on selected language (FR/EN)#8
Dcomp-commits wants to merge 2 commits into
psykokwak-com:masterfrom
Dcomp-commits:feature/i18n

Conversation

@Dcomp-commits
Copy link
Copy Markdown

Summary

  • Adds a JS i18n system to the dashboard: the entire UI switches to French or English instantly when the user changes the Language dropdown in General Settings
  • ~100 translation keys per language covering all labels, buttons, card titles, status messages, scheduler grid day names, and confirm dialogs
  • No server-side cost: a single new endpoint (/admin/langvalue) returns the saved language index; all translation logic runs in the browser

Note: this PR builds on top of PR #7 (scheduler). The scheduler section is included here and is also translated.

Implementation

  • Page_general.h — new send_lang_value_html() serving /admin/langvalue
  • Page_index.hdata-i18n attributes on all static text; I18N dictionary (FR/EN); T() / applyI18n() / initI18n() helpers; updatelang() calls applyI18n() immediately; loadGeneralSettings() re-syncs currentLang after AJAX reload; all JS-generated strings use T()
  • TexTime.ino — registers /admin/langvalue; fixes setAPssid() (missing APPassword argument)

Test plan

  • Open dashboard with FR device → UI displays in French on load
  • Change Language dropdown to English → UI switches instantly, no reload
  • Save → reload page → language persists
  • All sections (General, Network, NTP, MQTT, Scheduler, Firmware) fully translated
  • Scheduler RAZ confirm dialog and day labels translated
  • Save/Saved/Error button states translated

🤖 Generated with Claude Code

Dcomp-commits and others added 2 commits May 17, 2026 17:55
Adds a weekly scheduler that overrides the general display settings at
configurable half-hour intervals. Users define rules (mode, color,
color randomization, animation, speed, brightness range) then paint
time slots in a 7-day × 24-hour grid (each hour split in two halves).

Implementation:
- Page_scheduler.h: EEPROM read/write for 336 half-hour slots (7×48×8B),
  bulk save endpoint, apply-now endpoint, handleScheduler() called from loop()
- Page_index.h: scheduler section with rule editor and interactive grid;
  click/drag to paint slots; single bulk POST to save entire grid at once
- Page_style.css.h: scheduler grid and rule list CSS
- global.h: SCHEDULER_EEPROM_BASE (1024) and SCHEDULER_SLOT_SIZE (8) defines
- TexTime.ino: EEPROM.begin 1024→4096, include + routes + loop call

EEPROM usage: existing config ends at ~778; scheduler starts at 1024,
uses 2689 bytes (1 header + 336×8). Total: 3713 / 4096 bytes.
ESP8266 supports EEPROM.begin() up to 4096 bytes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a JavaScript i18n system so the entire dashboard UI switches
language automatically when the user changes the Language setting.

Implementation:
- Page_general.h: new /admin/langvalue endpoint returning _config.language
- Page_index.h: ~100-key I18N dictionary (FR/EN), data-i18n attributes on
  all static text elements, T()/applyI18n()/initI18n() helpers; updatelang()
  now calls applyI18n() immediately; loadGeneralSettings() syncs currentLang
  after reload; all JS-generated strings (save states, network status,
  scheduler grid day labels, confirm dialogs) use T()
- TexTime.ino: register /admin/langvalue route; fix setAPssid() call
  (missing APPassword argument)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Dcomp-commits
Copy link
Copy Markdown
Author

remplacé par #9

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