Move computeRTL to a separate file and add RTL support in state-info (#2165)

* RTL support (POC)

* restore yarn.lock

* Move computeRTL to a separate file and add RTL support in state-info

* Move import to top after failed CI

* Replace var to const

* Change HassEntity to HomeAssistant object

* Support RTL in state info and state card display

* Support for RTL in more-info-controls:

* Update src/common/util/compute_rtl.ts

Co-Authored-By: rhayun <ronen.hayun@gmail.com>

* remove default from export

* prefix all computeRTL with underscroe for privately uses
This commit is contained in:
Ronen Hayun
2018-12-03 11:54:29 +02:00
committed by Paulus Schoutsen
parent d015fe5160
commit 57b5db4f43
5 changed files with 69 additions and 7 deletions

View File

@@ -0,0 +1,9 @@
import { HomeAssistant } from "../../types";
export function computeRTL(hass: HomeAssistant) {
const lang = hass.language || "en";
if (hass.translationMetadata.translations[lang]) {
return hass.translationMetadata.translations[lang].isRTL || false;
}
return false;
}