mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-05 17:09:48 +00:00
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:
committed by
Paulus Schoutsen
parent
d015fe5160
commit
57b5db4f43
9
src/common/util/compute_rtl.ts
Normal file
9
src/common/util/compute_rtl.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user