Files
homeassistant_espscreen/tests/screen_text_en.h
T
Max Gramser 125346d94e Notation like Home Assistant, each screen in its own language, and the language in every build
From the end-to-end test on the bench boards and an independent review:
- Units spaced as Home Assistant does (54% / 54 % in German and French, 18°, 21.5 °C), in the firmware and the app.
- Grouping from five digits where the language does (1234 but 12.345 in Spanish, Polish, Portuguese): the layout
  message carries group_min and percent_space; an unknown number style no longer refuses a layout.
- Automatic follows Home Assistant's own language for the clock and numbers, also without a translation (Swedish:
  24 hours, 1 234,5; pt-BR: 1.234,5): regions.json from the CLDR for all 63 languages Home Assistant offers.
- 12-hour clock: the top bar says 3:48 PM, the clock card 3:48 (not 03:48), Last runs follow the clock.
- The climate setpoint font has the decimal comma; the value fonts have ², ³ and µ (m³ was a box).
- Weather days: at most three letters without the dot (mié, sáb, czw); the screen took three bytes.
- Texts fall back per key through the base language (pt-BR -> pt -> en) in the firmware and the app.
- Each screen gets the app's words in the language its firmware speaks; firmware from before the languages gets
  English and its own letters, not boxes.
- set_language re-reads what it writes (indentation, comments, quoted keys, CRLF, !include) and every build writes
  the language first; the 24-hour pin no longer hits a fresh install and waits for the old clock switches.
- Tests: region and notation, plural parity with the C++ rules, set_language edge cases, the pin, PUT /api/language.

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

318 lines
5.8 KiB
C

// GENERATED by tools/i18n.py (`python3 tools/i18n.py header`): the English texts for the C++ tests, which
// build a header without ESPHome and so without the table a screen's build writes into main.cpp.
#pragma once
#include "components/smart_display/screen_text.h"
static_assert(screen_text::KEYS_HASH == 0x5DBB4605u && screen_text::KEY_COUNT == 306,
"screen_text_keys.h does not match screen_manager/translations/en.json: run tools/i18n.py header");
const char *const screen_text::TABLE[] = {
".",
",",
"1",
"%",
"Just now",
"{n} min ago",
"1 hour ago | {n} hours ago",
"Yesterday",
"1 day ago | {n} days ago",
"1 week ago | {n} weeks ago",
"1 month ago | {n} months ago",
"1 year ago | {n} years ago",
"In {n} min",
"In 1 hour | In {n} hours",
"Tomorrow",
"In 1 day | In {n} days",
"AM",
"PM",
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Su",
"Mo",
"Tu",
"We",
"Th",
"Fr",
"Sa",
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
"{weekday} {day} {month}",
"{weekday} {day} {month}",
"{day} {month}",
"{weekday} {time}",
"{n} s",
"{n} min",
"{n} h",
"{h} h {m} min",
"{n} d",
"{d} d {h} h",
"Connecting to Home Assistant",
"Waiting for ESP Screens",
"Loading tiles...",
"HA not connected",
"ESP Screens not active",
"Choose tiles in HA",
"Home",
"No network",
"Settings",
"Brightness",
"Night",
"Screen",
"This screen",
"Dark mode",
"Auto standby",
"Standby after",
"Standby brightness",
"Night mode",
"Starts",
"Ends",
"Night brightness",
"Back to page 1",
"After",
"Also on standby",
"Swipe between pages",
"Page buttons",
"Rotation",
"Address",
"Firmware",
"Home Assistant",
"Restart",
"Connected",
"Not connected",
"Tap again to restart",
"{n} sec",
"{n} min",
"{n} h",
"{h} h {m}",
"Tap to open",
"Page {n}",
"Refused",
"Command sent...",
"Confirmed by Home Assistant",
"Notification",
"OK",
"Color",
"Color temperature",
"Brightness",
"Waiting...",
"Effect",
"Nothing to choose",
"Loading...",
"Not connected",
"Target",
"Mode",
"Fan",
"Swing",
"Now {value}",
"Check the robot in HA",
"Automatic suction power",
"The robot chooses suction and water",
"Suction and water as set per room",
"Quiet",
"Normal",
"Turbo",
"Max",
"Pause cleaning",
"Pause",
"Resume",
"Start cleaning",
"Clean",
"Dock",
"Position",
"Tilt",
"Tilt {n}%",
"Feels like {n}\302\260",
"No daily forecast from Home Assistant",
"Coming days",
"No data",
"average",
"average of {duration}",
"Now",
"1 hour",
"24 hours",
"1 week",
"High {value}",
"Low {value}",
"once | {n} times",
"Loading history...",
"No history in this period",
"No history available",
"Muted",
"Not playing",
"Loading",
"Running",
"Paused",
"Stopped",
"Pause",
"Start",
"Cancel",
"Paused {time}",
"Sun",
"Sunrise {time}",
"Sunset {time}",
"rise {time}",
"set {time}",
"Running...",
"Never run",
"Last {time}",
"Yesterday {time}",
"Last {date}",
"No image from this camera",
"Loading image",
"Live",
"Recording",
"Tap to view",
"No image yet",
"Follow the calibration wizard",
"GT911 touch check",
"Hold each tap for a moment",
"Tap the crosshair\012Point {point}/5 - tap {tap}/3",
"Tap gently, a bit longer",
"Tap the same crosshair 3 times",
"Measurement rejected; try again",
"Save failed; try again",
"On",
"Off",
"Unavailable",
"Off",
"Heat",
"Cool",
"Heat/Cool",
"Auto",
"Dry",
"Fan only",
"Heating",
"Cooling",
"Idle",
"Off",
"Drying",
"Fan",
"Preheating",
"Defrosting",
"Open",
"Closed",
"Opening",
"Closing",
"Playing",
"Paused",
"Idle",
"Standby",
"Home",
"Away",
"Above horizon",
"Below horizon",
"Docked",
"Cleaning",
"Paused",
"Returning to dock",
"Idle",
"Sunny",
"Clear, night",
"Cloudy",
"Partly cloudy",
"Rainy",
"Pouring",
"Snowy",
"Snowy, rainy",
"Fog",
"Hail",
"Lightning",
"Lightning, rainy",
"Windy",
"Exceptional",
"Low",
"Normal",
"Charging",
"Not charging",
"Detected",
"Clear",
"Cold",
"Normal",
"Connected",
"Disconnected",
"Open",
"Closed",
"Open",
"Closed",
"Detected",
"Clear",
"Hot",
"Normal",
"Light detected",
"No light",
"Unlocked",
"Locked",
"Wet",
"Dry",
"Detected",
"Clear",
"Moving",
"Not moving",
"Detected",
"Clear",
"Open",
"Closed",
"Plugged in",
"Unplugged",
"On",
"Off",
"Home",
"Away",
"Problem",
"OK",
"Running",
"Not running",
"Unsafe",
"Safe",
"Detected",
"Clear",
"Detected",
"Clear",
"Tampering detected",
"Clear",
"Update available",
"Up-to-date",
"Detected",
"Clear",
"Open",
"Closed",
"Activate",
"Run",
"Press"
};
const char *const screen_text::LANGUAGE = "en";
int screen_text::plural_index(int n) { return n == 1 ? 0 : 1; }