mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 01:36:49 +00:00
Use en "–" and em "—" dashes consistently (#11401)
This commit is contained in:
parent
22b4550fdf
commit
72bd5f84d6
@ -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(" ");
|
||||
|
@ -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(
|
||||
|
@ -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);
|
||||
|
@ -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}`;
|
||||
|
@ -320,7 +320,7 @@ export class HaConfigDeviceDashboard extends LitElement {
|
||||
.batteryChargingStateObj=${batteryCharging}
|
||||
></ha-battery-icon>
|
||||
`
|
||||
: html` - `;
|
||||
: html`—`;
|
||||
},
|
||||
};
|
||||
if (showDisabled) {
|
||||
|
@ -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} `
|
||||
: ""}
|
||||
</div>
|
||||
`
|
||||
@ -132,8 +132,8 @@ export class HaConfigLovelaceDashboards extends LitElement {
|
||||
width: "100px",
|
||||
template: (requireAdmin: boolean) =>
|
||||
requireAdmin
|
||||
? html` <ha-svg-icon .path=${mdiCheck}></ha-svg-icon> `
|
||||
: html` - `,
|
||||
? html`<ha-svg-icon .path=${mdiCheck}></ha-svg-icon>`
|
||||
: html`—`,
|
||||
};
|
||||
columns.show_in_sidebar = {
|
||||
title: this.hass.localize(
|
||||
@ -143,8 +143,8 @@ export class HaConfigLovelaceDashboards extends LitElement {
|
||||
width: "121px",
|
||||
template: (sidebar) =>
|
||||
sidebar
|
||||
? html` <ha-svg-icon .path=${mdiCheck}></ha-svg-icon> `
|
||||
: html` - `,
|
||||
? html`<ha-svg-icon .path=${mdiCheck}></ha-svg-icon>`
|
||||
: html`—`,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -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"),
|
||||
|
@ -274,7 +274,7 @@ class HuiEnergyDistrubutionCard
|
||||
? formatNumber(lowCarbonEnergy, this.hass.locale, {
|
||||
maximumFractionDigits: 1,
|
||||
})
|
||||
: "-"}
|
||||
: "—"}
|
||||
kWh
|
||||
</a>
|
||||
<svg width="80" height="30">
|
||||
|
@ -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
|
||||
)}`;
|
||||
|
@ -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
|
||||
)}`;
|
||||
|
@ -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
|
||||
)}`;
|
||||
|
@ -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
|
||||
)}`}
|
||||
|
@ -75,7 +75,7 @@ class HuiAttributeRow extends LitElement implements LovelaceRow {
|
||||
? formatNumber(attribute, this.hass.locale)
|
||||
: attribute !== undefined
|
||||
? formatAttributeValue(this.hass, attribute)
|
||||
: "-"}
|
||||
: "—"}
|
||||
${this._config.suffix}
|
||||
</hui-generic-entity-row>
|
||||
`;
|
||||
|
@ -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 = <T extends Constructor<HassBaseEl>>(
|
||||
|
@ -176,7 +176,7 @@ export function formatAttributeValue(
|
||||
value: any
|
||||
): string | TemplateResult {
|
||||
if (value === null) {
|
||||
return "-";
|
||||
return "—";
|
||||
}
|
||||
|
||||
// YAML handling
|
||||
|
Loading…
x
Reference in New Issue
Block a user