JudicialCouncilOfCalifornia / courtyard

Judicial Council Pattern Library
GNU General Public License v2.0
6 stars 5 forks source link

RTL Language Support #294

Open slowbot opened 4 years ago

slowbot commented 4 years ago

We'll need to investigate and implement right to left language support in Pattern Lab in order to test individual components.

Initial tests showed that applying the dir="rtl" class to the html element of Pattern Lab did not have an effect but applying it to the body element did effect the components.

@zakiya

  1. How does Drupal implement right to left natively?
  2. Is there a way we can simulate this in Pattern Lab?
  3. Do you have examples of previous implementations we can look at?
zakiya commented 4 years ago
  1. All Drupal sites have a dir attribute in the html tag. (See selfhelf.courts.ca.gov.) When the language is set to a rtl language, it's [dir="rtl"]. All it does by default is change the text direction. (See w3schools)

  2. In places where margins, positioning etc need to be changed, I would just add the appropriate css inline [dir="rtl"] .my class { }. For demo purposes you could add another select to the theme switcher to switch between rtl and ltr.

  3. Here's an example of a multilingual Drupal 8 site: http://iraplegalinfo.org/en/language/selection