Files
Max Gramser 378d0b3e61 Build each screen in one language: the screen texts from the translations, European letters in the fonts, and Language & region in the app
The firmware takes its texts from screen_manager/translations/<code>.json at build time (components/smart_display:
one table in main.cpp, keys in screen_text_keys.h), and the fonts carry every letter European languages write with.
The app keeps Settings -> Language & region (language, clock, numbers) for every screen, writes LANGUAGE into the
screens' YAML and sends the clock and the number format in the layout message; the per-screen 24-hour clock goes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 14:24:19 +02:00

22 lines
931 B
C++

#include "screen_text_en.h"
#include "components/smart_display/screen_settings.h"
#include <cassert>
int main() {
using screen_settings::Settings;
Settings s;
assert(s.valid() && s.standby_seconds == 600);
assert(s.dim_level(-1) == 20); // No time sync must not accidentally select night.
assert(s.dim_level(1319) == 20 && s.dim_level(1320) == 10);
assert(s.dim_level(419) == 10 && s.dim_level(420) == 20);
s.night_start = 60; s.night_end = 120;
assert(!s.night(59) && s.night(60) && !s.night(120));
s.night_end = 60; assert(!s.night(60) && !s.night(0));
auto copy = s; assert(copy == s);
copy.clock_24h = 0; assert(!(copy == s));
s.brightness = 5; assert(!s.valid());
s.standby_brightness = s.night_brightness = 0; assert(s.valid());
s.standby_seconds = 86401; assert(!s.valid());
s.standby_seconds = 60; s.show_clock = 2; assert(!s.valid());
s.show_clock = 1; s.version = 2; assert(!s.valid());
}