The editor's mockup writes like the screens, and speaks its own language around them
- Numbers in the mockup follow what the app sends the screens (style, grouping from five digits, the space before %), a state without a unit stays as it is, and built-in cards carry the screens' names (Instellingen, not the editor's Einstellungen). - Automatic in Language & region is labelled with what it means now (Home Assistant's language decides). - A screen's status (Synced, Loading tiles, ...) shows in the editor's language; the screens keep reporting it in English, which the app reads. - The doorbell example uses the alert examples of the editor's language; control labels keep their capitals. - Editor bundle rebuilt with every language's texts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -181,7 +181,8 @@ describe("the mockup speaks the screens' language", () => {
|
||||
}, meta("one_other"));
|
||||
state.inventory = {
|
||||
screens: [], entities: [{ id: "light.b", name: "Lamp B", state: "unavailable" }],
|
||||
language: { setting: "td", effective: "td", ha: "en", languages: [], numbers: "auto" },
|
||||
// The add-on says how the screens write numbers: Automatic, worked out for their language (1.234,5).
|
||||
language: { setting: "td", effective: "td", ha: "en", languages: [], numbers: "auto", numbers_effective: "comma", group_min: 2 },
|
||||
controls: { script: { default: "run", choices: [{ key: "run", label: "Run" }, { key: "none", label: "None" }] } },
|
||||
} as any;
|
||||
state.layout = { title: "Living room", tiles: [] };
|
||||
|
||||
@@ -13,6 +13,7 @@ const GUIDE = "https://github.com/MaxGramser/homeassistant_espscreen/blob/main/d
|
||||
function language(extra: Partial<Languages> = {}): Languages {
|
||||
return {
|
||||
setting: "auto", effective: "nl", ha: "nl", clock: "auto", clock_effective: "24", numbers: "auto", numbers_effective: "comma",
|
||||
clock_auto: "24", numbers_auto: "comma", group_min: 1, group_min_auto: 1, percent_space: false,
|
||||
languages: [
|
||||
{ code: "en", name: "English (US)", english: "English (US)", checked: true },
|
||||
{ code: "en-GB", name: "English (UK)", english: "English (UK)", checked: true },
|
||||
|
||||
@@ -94,7 +94,7 @@ describe("defaults, controls and versions", () => {
|
||||
expect(effectiveControls(tile("light.a", 0, { size: "wide", inline: "slider" }), inventory)).toBeNull();
|
||||
expect(effectiveControls(tile("light.a", 0, { size: "wide", display: "watch" }), inventory)).toBeNull();
|
||||
expect(effectiveControls(tile("light.a", 0), inventory)).toBeNull();
|
||||
expect(controlsLabel(tile("light.a", 0, { size: "wide" }), inventory)).toBe("on/off switch");
|
||||
expect(controlsLabel(tile("light.a", 0, { size: "wide" }), inventory)).toBe("On/off switch");
|
||||
expect(controlsLabel(tile("sensor.t", 0, { size: "wide" }), inventory)).toBe("none");
|
||||
});
|
||||
it("compares firmware versions and knows the tile limit", () => {
|
||||
|
||||
Reference in New Issue
Block a user