How to control the direction of the Sitemap, to support Hebrew and Arabic?

Hi.

openHAB seems to support Hebrew nicely.
However, the web page is rendered from the sitemap in English direction - Left To Right (LTR); while in Hebrew (and Arabic) the page should be rendered from Right To Left (RTL).

This can be acheived by simply adding dir="rtl" to html or body tags.

I think that Sitemaps should have some direction configuration.
Until it’s implemented, is there a way that I can ‘inject’ the dir directive myself?

Thanks

1 Like

Hi.
Anyone has any input on this?
Maybe @Kai ?

Thanks

Sorry, I never looked into this so far.
Would that be needed to be built in the different UIs? Does the sitemap need to have a direction flag in order to tell the UIs how to render it? Or can UIs derive this from some language setting automatically?

1 Like

Well, I’m not familiar enough with the different UIs, so maybe I’m making some stupid mistake here :slight_smile:

Direction can be derived from language - but how the UI knows what is the language?

If I understand correctly, having the ‘direction’ built in the UI might annoy many users. An English sitemap, that got automatically rendered as-if it was Hebrew is very annoying to look at.
Here’s an example, of your text ;), with the wrong direction:

Just because my device is usually in Hebrew (or Arabic) doesn’t mean that I want to have everything rendered from Right to Left - only the Hebrew text…

Therefore, I think it’d be best to have it as a property of the Sitemap, and allow creating an English sitemap with LTR text, and another Hebrew Sitemap, with RTL - no matter what’s the default language my device is usually using.

An interesting question, which is up to you to decide, is whether to add a direction property (that will be translated to HTML’s dir), or to add a language property to the sitemap (which will automatically set appropriate dir).

For the current problem, having direction is enough, and there is no specific added value in language that I’m aware of now; however, life are full of surprises, and maybe in the future a language will be useful.
Either way, as far as I understand, there is no need to have both of them.

Thanks!

1 Like

Does anyone have new insights/workarounds for this?

FYI,
As a workaround, I used the CSS theming method with myStyle.css consists:

.page-content {
    direction: rtl;  /* Right to Left */
    unicode-bidi:bidi-override;
}

.mdl-form__title {
    margin-right: 8pt
}

which turn:


into:

Pretty neat :grinning: