1
mirror of https://github.com/home-assistant/frontend synced 2024-09-30 15:52:53 +02:00

Fixed heading (concat) to support RTL (name comes last)

This commit is contained in:
Yosi Levy 2020-07-20 07:49:09 +03:00
parent 377c37425e
commit e6b9389b33

View File

@ -30,7 +30,10 @@ import "./hui-card-preview";
import type { EditCardDialogParams } from "./show-edit-card-dialog";
import { getCardDocumentationURL } from "../get-card-documentation-url";
import { mdiHelpCircle } from "@mdi/js";
import { computeRTLDirection } from "../../../../common/util/compute_rtl";
import {
computeRTL,
computeRTLDirection,
} from "../../../../common/util/compute_rtl";
declare global {
// for fire event
@ -101,9 +104,16 @@ export class HuiDialogEditCard extends LitElement {
let heading: string;
if (this._cardConfig && this._cardConfig.type) {
heading = `${this.hass!.localize(
`ui.panel.lovelace.editor.card.${this._cardConfig.type}.name`
)} ${this.hass!.localize("ui.panel.lovelace.editor.edit_card.header")}`;
heading = computeRTL(this.hass)
? `${this.hass!.localize("ui.panel.lovelace.editor.edit_card.header")}
${this.hass!.localize(
`ui.panel.lovelace.editor.card.${this._cardConfig.type}.name`
)}`
: `${this.hass!.localize(
`ui.panel.lovelace.editor.card.${this._cardConfig.type}.name`
)} ${this.hass!.localize(
"ui.panel.lovelace.editor.edit_card.header"
)}`;
} else if (!this._cardConfig) {
heading = this._viewConfig.title
? this.hass!.localize(