Use en "–" and em "—" dashes consistently (#11401)

This commit is contained in:
Philip Allgaier 2022-01-24 10:02:44 +01:00 committed by GitHub
parent 22b4550fdf
commit 72bd5f84d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 19 additions and 19 deletions

View File

@ -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(" ");

View File

@ -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(

View File

@ -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);

View File

@ -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}`;

View File

@ -320,7 +320,7 @@ export class HaConfigDeviceDashboard extends LitElement {
.batteryChargingStateObj=${batteryCharging}
></ha-battery-icon>
`
: html` - `;
: html``;
},
};
if (showDisabled) {

View File

@ -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``,
};
}

View File

@ -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"),

View File

@ -274,7 +274,7 @@ class HuiEnergyDistrubutionCard
? formatNumber(lowCarbonEnergy, this.hass.locale, {
maximumFractionDigits: 1,
})
: "-"}
: ""}
kWh
</a>
<svg width="80" height="30">

View File

@ -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
)}`;

View File

@ -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
)}`;

View File

@ -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
)}`;

View File

@ -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
)}`}

View File

@ -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>
`;

View File

@ -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>>(

View File

@ -176,7 +176,7 @@ export function formatAttributeValue(
value: any
): string | TemplateResult {
if (value === null) {
return "-";
return "";
}
// YAML handling