From e6b9389b33005c2669745d5d10fc730e28671fd4 Mon Sep 17 00:00:00 2001 From: Yosi Levy Date: Mon, 20 Jul 2020 07:49:09 +0300 Subject: [PATCH] Fixed heading (concat) to support RTL (name comes last) --- .../editor/card-editor/hui-dialog-edit-card.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts index 6dfa04595f..8ff6fd9bfe 100755 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts @@ -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(