dannyconnell / quasalang

Generate Quasar i18n language files from a CSV file
38 stars 14 forks source link

Example of language switcher with LocalStorage and RTL language? #9

Open LiamKarlMitchell opened 2 years ago

LiamKarlMitchell commented 2 years ago

Hi Danny,

Trying to use with Arabic, and the Quasar language switcher does not seem to be working.

Wanting to auto detect locale and use if available, but if set by user (stored in LocalStorage) then to use one that is set if possible with a fallback. I have the LocalStorage part working, but the RTL languages like Arabic are still be on the left align rather than rtl.

I have build config with rtl=true in the quasar.conf. It's like its not loading the language pack from Quasar I'm sure i'm doing something wrong just thought I'de ask if you have an example of this kind of language switcher for a recent Quasar version?

dannyconnell commented 2 years ago

You might need to dynamically toggle the dir property on the element(s) where the text is displayed (when a rtl language is selected), e.g:

<div dir="rtl">
  <!--
    rtl content
  -->
</div>