Skip to content

Document right-to-left support - #58

Open
mabruchet wants to merge 1 commit into
thelia:mainfrom
mabruchet:feat/341-rtl-support
Open

mabruchet wants to merge 1 commit into
thelia:mainfrom
mabruchet:feat/341-rtl-support

Conversation

@mabruchet

Copy link
Copy Markdown
Contributor

Adds a Front-Office page documenting right-to-left support, so an integrator building a custom theme inherits the rules rather than reverse-engineering them from Flexy.

What it covers

  • The direction is deduced, never chosen — from the language code alone, against a list held in the core. Why there is no setting, no column and no migration, and what the list contains.
  • Reading it — the lang_direction() Twig function and the lang_direction variable it supersedes, with the fallback spelled out, plus the PHP entry points.
  • Writing styles that follow the reading direction — the split between a logical property and an explicit rtl: variant, and the note that a centring left: 50% is not a side.
  • Directional icons — mirrored with a class on the wrapper, never with a second set of SVG files.
  • Values that must not flip — prices, phone numbers, references, tracking numbers, with the two traps that cost real time: dir="ltr" on a block element re-resolves its own text-align, and merchant-typed text wants <bdi> rather than a forced direction.
  • JavaScript widgets — read the attribute from the DOM, not a render variable, so they survive a re-render.
  • Why there is no second stylesheet, since other platforms ship one and the question will come up.
  • A checklist an integrator can run against their own theme.

What it says is out of scope

PDF invoices and delivery notes, transactional e-mails, translating a theme into a right-to-left language, adding such a language to the default install, and formatting numbers in local digits.

Part of Thelia issue #341. Describes what ships in thelia/thelia#3972, thelia-modules/TwigEngine#14, thelia-templates/flexy#218 and thelia-templates/default-twig#91 — worth merging once those are in.

What the core deduces, how a template reads it, and the rules a theme follows:
logical properties for what follows the reading direction, explicit variants for
graphic choices, and isolation for the values that must not flip.

Refs thelia/v2/thelia-2.6#341
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant