From 98e8170b8bdce1315bc9134c77374a642190bbbd Mon Sep 17 00:00:00 2001 From: Vitali Date: Sat, 25 Jul 2026 11:15:26 +0700 Subject: [PATCH] feat(web): RU/EN language toggle (Russian default) Client-side i18n: static labels via data-i18n, dial zone words, and the 26 Zambretti phrases + categories + trend words translated in the browser. Choice persists in localStorage. Device firmware unchanged (API stays English; TFT stays Latin). Co-Authored-By: Claude Opus 4.8 --- WeatherPredictor/web_page.h | 173 ++++++++++++++++++++++++++++-------- 1 file changed, 135 insertions(+), 38 deletions(-) diff --git a/WeatherPredictor/web_page.h b/WeatherPredictor/web_page.h index e306cdf..3a6b8e7 100644 --- a/WeatherPredictor/web_page.h +++ b/WeatherPredictor/web_page.h @@ -39,6 +39,11 @@ static const char INDEX_HTML[] PROGMEM = R"HTML( } .lede{color:var(--muted); font-size:.92rem; margin:8px 0 0} .lede b{color:var(--text); font-weight:600} + header{position:relative} + .lang{position:absolute; top:0; right:0; display:flex; gap:3px} + .lang button{padding:4px 9px; font-size:.72rem; font-weight:700; letter-spacing:.06em; font-family:var(--sans); + background:transparent; color:var(--muted); border:1px solid var(--line); border-radius:7px; cursor:pointer} + .lang button.on{background:var(--brass); color:#221a06; border-color:var(--brass)} .panel{ background:linear-gradient(180deg, var(--surface), #14203a); @@ -153,9 +158,10 @@ static const char INDEX_HTML[] PROGMEM = R"HTML(
-

Barometric Forecaster

-

Weather Predictor

-

Reading the sky by pressure alone, the Zambretti way — station at +

+

Barometric Forecaster

+

Weather Predictor

+

Reading the sky by pressure alone, the Zambretti way — station at 54.99°N, 82.87°E.

@@ -164,7 +170,7 @@ static const char INDEX_HTML[] PROGMEM = R"HTML(
---- - hPa · sea level + hPa · sea level

Reading the sky…

@@ -173,18 +179,18 @@ static const char INDEX_HTML[] PROGMEM = R"HTML(
-
Local time
--:--
-
Temperature
--
degrees celsius
-
3-hour move
+
Local time
--:--
+
Temperature
--
degrees celsius
+
3-hour move
-

Barograph

+

Barograph

- Pressure - Temperature + Pressure + Temperature
@@ -199,7 +205,7 @@ static const char INDEX_HTML[] PROGMEM = R"HTML(
-

Forecast log

+

Forecast log

    @@ -207,27 +213,27 @@ static const char INDEX_HTML[] PROGMEM = R"HTML(
    - Station settings Adjust + Station settings Adjust
    - +
    -
    -
    -
    -
    +
    +
    +
    +
    - +
    -
    Served from the station · works without internet
    +
    Served from the station · works without internet