From 72bd5f84d6fa5ff2e02850e30e78d621fbc72d53 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Mon, 24 Jan 2022 10:02:44 +0100 Subject: [PATCH] =?UTF-8?q?Use=20en=20"=E2=80=93"=20and=20em=20"=E2=80=94"?= =?UTF-8?q?=20dashes=20consistently=20(#11401)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/entity/compute_state_display.ts | 2 +- src/components/entity/ha-state-label-badge.ts | 2 +- src/components/ha-attributes.ts | 2 +- src/components/ha-water_heater-state.js | 2 +- .../config/devices/ha-config-devices-dashboard.ts | 2 +- .../dashboards/ha-config-lovelace-dashboards.ts | 10 +++++----- src/panels/config/users/ha-config-users.ts | 2 +- .../cards/energy/hui-energy-distribution-card.ts | 2 +- .../lovelace/cards/energy/hui-energy-gas-graph-card.ts | 2 +- .../cards/energy/hui-energy-solar-graph-card.ts | 2 +- .../cards/energy/hui-energy-usage-graph-card.ts | 2 +- .../lovelace/components/hui-energy-period-selector.ts | 2 +- src/panels/lovelace/special-rows/hui-attribute-row.ts | 2 +- src/state/panel-title-mixin.ts | 2 +- src/util/hass-attributes-util.ts | 2 +- 15 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/common/entity/compute_state_display.ts b/src/common/entity/compute_state_display.ts index adf62f2104..590f798d94 100644 --- a/src/common/entity/compute_state_display.ts +++ b/src/common/entity/compute_state_display.ts @@ -43,7 +43,7 @@ export const computeStateDisplay = ( if (domain === "input_datetime") { if (state !== undefined) { - // If trying to display an explicit state, need to parse the explict state to `Date` then format. + // If trying to display an explicit state, need to parse the explicit state to `Date` then format. // Attributes aren't available, we have to use `state`. try { const components = state.split(" "); diff --git a/src/components/entity/ha-state-label-badge.ts b/src/components/entity/ha-state-label-badge.ts index 19ea56dbcf..919ad6de55 100644 --- a/src/components/entity/ha-state-label-badge.ts +++ b/src/components/entity/ha-state-label-badge.ts @@ -147,7 +147,7 @@ export class HaStateLabelBadge extends LitElement { default: return entityState.state === UNKNOWN || entityState.state === UNAVAILABLE - ? "-" + ? "—" : isNumericState(entityState) ? formatNumber(entityState.state, this.hass!.locale) : computeStateDisplay( diff --git a/src/components/ha-attributes.ts b/src/components/ha-attributes.ts index 8168043eb8..5e47290df7 100644 --- a/src/components/ha-attributes.ts +++ b/src/components/ha-attributes.ts @@ -120,7 +120,7 @@ class HaAttributes extends LitElement { private formatAttribute(attribute: string): string | TemplateResult { if (!this.stateObj) { - return "-"; + return "—"; } const value = this.stateObj.attributes[attribute]; return formatAttributeValue(this.hass, value); diff --git a/src/components/ha-water_heater-state.js b/src/components/ha-water_heater-state.js index 8e6759ea6d..c9bd1147ac 100644 --- a/src/components/ha-water_heater-state.js +++ b/src/components/ha-water_heater-state.js @@ -64,7 +64,7 @@ class HaWaterHeaterState extends LocalizeMixin(PolymerElement) { return `${formatNumber( stateObj.attributes.target_temp_low, this.hass.locale - )} - ${formatNumber( + )} – ${formatNumber( stateObj.attributes.target_temp_high, this.hass.locale )} ${hass.config.unit_system.temperature}`; diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts index 39079858df..d26c099e1b 100644 --- a/src/panels/config/devices/ha-config-devices-dashboard.ts +++ b/src/panels/config/devices/ha-config-devices-dashboard.ts @@ -320,7 +320,7 @@ export class HaConfigDeviceDashboard extends LitElement { .batteryChargingStateObj=${batteryCharging} > ` - : html` - `; + : html`—`; }, }; if (showDisabled) { diff --git a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts index ab858b317f..63623ccb21 100644 --- a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts +++ b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts @@ -89,7 +89,7 @@ export class HaConfigLovelaceDashboards extends LitElement { ${this.hass.localize( `ui.panel.config.lovelace.dashboards.conf_mode.${dashboard.mode}` )}${dashboard.filename - ? html` - ${dashboard.filename} ` + ? html` – ${dashboard.filename} ` : ""} ` @@ -132,8 +132,8 @@ export class HaConfigLovelaceDashboards extends LitElement { width: "100px", template: (requireAdmin: boolean) => requireAdmin - ? html` ` - : html` - `, + ? html`` + : html`—`, }; columns.show_in_sidebar = { title: this.hass.localize( @@ -143,8 +143,8 @@ export class HaConfigLovelaceDashboards extends LitElement { width: "121px", template: (sidebar) => sidebar - ? html` ` - : html` - `, + ? html`` + : html`—`, }; } diff --git a/src/panels/config/users/ha-config-users.ts b/src/panels/config/users/ha-config-users.ts index a4e823c64c..57faf9a2e6 100644 --- a/src/panels/config/users/ha-config-users.ts +++ b/src/panels/config/users/ha-config-users.ts @@ -67,7 +67,7 @@ export class HaConfigUsers extends LitElement { width: "20%", direction: "asc", hidden: narrow, - template: (username) => html` ${username || "-"} `, + template: (username) => html`${username || "—"}`, }, group_ids: { title: localize("ui.panel.config.users.picker.headers.group"), diff --git a/src/panels/lovelace/cards/energy/hui-energy-distribution-card.ts b/src/panels/lovelace/cards/energy/hui-energy-distribution-card.ts index 58e49fe765..1f85a6e857 100644 --- a/src/panels/lovelace/cards/energy/hui-energy-distribution-card.ts +++ b/src/panels/lovelace/cards/energy/hui-energy-distribution-card.ts @@ -274,7 +274,7 @@ class HuiEnergyDistrubutionCard ? formatNumber(lowCarbonEnergy, this.hass.locale, { maximumFractionDigits: 1, }) - : "-"} + : "—"} kWh diff --git a/src/panels/lovelace/cards/energy/hui-energy-gas-graph-card.ts b/src/panels/lovelace/cards/energy/hui-energy-gas-graph-card.ts index da21cc8004..e1941a7c47 100644 --- a/src/panels/lovelace/cards/energy/hui-energy-gas-graph-card.ts +++ b/src/panels/lovelace/cards/energy/hui-energy-gas-graph-card.ts @@ -191,7 +191,7 @@ export class HuiEnergyGasGraphCard return datasets[0].label; } const date = new Date(datasets[0].parsed.x); - return `${formatTime(date, locale)} - ${formatTime( + return `${formatTime(date, locale)} – ${formatTime( addHours(date, 1), locale )}`; diff --git a/src/panels/lovelace/cards/energy/hui-energy-solar-graph-card.ts b/src/panels/lovelace/cards/energy/hui-energy-solar-graph-card.ts index 584da90561..157079a24e 100644 --- a/src/panels/lovelace/cards/energy/hui-energy-solar-graph-card.ts +++ b/src/panels/lovelace/cards/energy/hui-energy-solar-graph-card.ts @@ -184,7 +184,7 @@ export class HuiEnergySolarGraphCard return datasets[0].label; } const date = new Date(datasets[0].parsed.x); - return `${formatTime(date, locale)} - ${formatTime( + return `${formatTime(date, locale)} – ${formatTime( addHours(date, 1), locale )}`; diff --git a/src/panels/lovelace/cards/energy/hui-energy-usage-graph-card.ts b/src/panels/lovelace/cards/energy/hui-energy-usage-graph-card.ts index 69dab35389..e75a5776e3 100644 --- a/src/panels/lovelace/cards/energy/hui-energy-usage-graph-card.ts +++ b/src/panels/lovelace/cards/energy/hui-energy-usage-graph-card.ts @@ -177,7 +177,7 @@ export class HuiEnergyUsageGraphCard return datasets[0].label; } const date = new Date(datasets[0].parsed.x); - return `${formatTime(date, locale)} - ${formatTime( + return `${formatTime(date, locale)} – ${formatTime( addHours(date, 1), locale )}`; diff --git a/src/panels/lovelace/components/hui-energy-period-selector.ts b/src/panels/lovelace/components/hui-energy-period-selector.ts index 4a630160d1..8fa2ac19f1 100644 --- a/src/panels/lovelace/components/hui-energy-period-selector.ts +++ b/src/panels/lovelace/components/hui-energy-period-selector.ts @@ -103,7 +103,7 @@ export class HuiEnergyPeriodSelector extends SubscribeMixin(LitElement) { : `${formatDateShort( this._startDate, this.hass.locale - )} - ${formatDateShort( + )} – ${formatDateShort( this._endDate || new Date(), this.hass.locale )}`} diff --git a/src/panels/lovelace/special-rows/hui-attribute-row.ts b/src/panels/lovelace/special-rows/hui-attribute-row.ts index f50c8d4e41..3b7a7a62f2 100644 --- a/src/panels/lovelace/special-rows/hui-attribute-row.ts +++ b/src/panels/lovelace/special-rows/hui-attribute-row.ts @@ -75,7 +75,7 @@ class HuiAttributeRow extends LitElement implements LovelaceRow { ? formatNumber(attribute, this.hass.locale) : attribute !== undefined ? formatAttributeValue(this.hass, attribute) - : "-"} + : "—"} ${this._config.suffix} `; diff --git a/src/state/panel-title-mixin.ts b/src/state/panel-title-mixin.ts index 121c51d628..9a5bdfe6de 100644 --- a/src/state/panel-title-mixin.ts +++ b/src/state/panel-title-mixin.ts @@ -3,7 +3,7 @@ import { Constructor, HomeAssistant } from "../types"; import { HassBaseEl } from "./hass-base-mixin"; const setTitle = (title: string | undefined) => { - document.title = title ? `${title} - Home Assistant` : "Home Assistant"; + document.title = title ? `${title} – Home Assistant` : "Home Assistant"; }; export const panelTitleMixin = >( diff --git a/src/util/hass-attributes-util.ts b/src/util/hass-attributes-util.ts index cddc1d20d6..94523dc639 100644 --- a/src/util/hass-attributes-util.ts +++ b/src/util/hass-attributes-util.ts @@ -176,7 +176,7 @@ export function formatAttributeValue( value: any ): string | TemplateResult { if (value === null) { - return "-"; + return "—"; } // YAML handling