Wielojęzyczność

i18n/dir-rtl

Pages in right-to-left languages (Arabic, Hebrew, Persian, Urdu) set dir="rtl" on html together with lang.

poważnastatycznefe-i18n

Dlaczego

Without dir="rtl", text in these languages is laid out left to right: punctuation lands on the wrong side, mixed numbers and Latin words jump around, and the whole layout (navigation, form fields, scroll direction) reads backwards for the user.

Poprawka

Set dir in markup, not in CSS: <html lang="ar" dir="rtl">, from the same locale data that sets lang (a list of right-to-left languages, or Intl.Locale text info where the runtime has it). Write layout with logical properties so it mirrors without extra CSS. Use dir="auto" on fields and elements that show user-generated text.

Przykłady

<!-- bad -->
<html lang="ar">
<!-- good -->
<html lang="ar" dir="rtl">

Źródła

Fakty

Identyfikator
i18n/dir-rtl
Waga
poważna
Sprawdzanie
statyczne sprawdzane w kodzie źródłowym przez audit
Dotyczy plików
html vue svelte astro jsx
Uczy jej skill
fe-i18n Internationalisation
Od wersji
0.1.0

Plik reguły na GitHubie

Przeczytaj w terminalu

npx github:dawidolko/frontend-skills explain i18n/dir-rtl