Summary
The multilingual (ML) backend form controls don't apply right-to-left text direction when editing an RTL locale (e.g. Arabic, Hebrew, Persian). The input keeps direction: ltr, so RTL content is edited with left alignment and LTR cursor/punctuation behaviour — a poor editing experience for RTL languages.
Environment
wintercms/wn-translate-plugin (auto-translate-copy branch / current develop)
- Winter core
develop, PHP 8.4
- Locales configured:
en (default), plus ar (enabled)
Steps to reproduce
- Add and enable an RTL locale such as
ar.
- On any translatable field (e.g.
mltext), click the field's locale button and switch to ar.
- Type/paste Arabic text.
- Inspect the input.
Expected
When the active ML locale is right-to-left, the field's input/textarea/editor should render with dir="rtl" (right alignment, RTL caret and punctuation handling).
Actual
The input's computed style is direction: ltr (no dir attribute set). Arabic renders via the browser's inherent bidi handling, but the field itself is not RTL-aware, so alignment and caret behaviour are LTR.
Suggestion
Set dir="rtl" (or dir="auto") on the ML control's inputs/editors when the active locale is RTL. This likely needs:
- a way to know a locale is RTL (a per-locale
is_rtl flag on the Locale model, or a lookup by language code), and
- the ML partials + the locale-switch JS to toggle
dir on the active field when the locale changes.
This is an enhancement / accessibility gap rather than a regression — RTL has never been handled — but it's a real barrier for RTL-language sites.
Summary
The multilingual (ML) backend form controls don't apply right-to-left text direction when editing an RTL locale (e.g. Arabic, Hebrew, Persian). The input keeps
direction: ltr, so RTL content is edited with left alignment and LTR cursor/punctuation behaviour — a poor editing experience for RTL languages.Environment
wintercms/wn-translate-plugin(auto-translate-copy branch / current develop)develop, PHP 8.4en(default), plusar(enabled)Steps to reproduce
ar.mltext), click the field's locale button and switch toar.Expected
When the active ML locale is right-to-left, the field's input/textarea/editor should render with
dir="rtl"(right alignment, RTL caret and punctuation handling).Actual
The input's computed style is
direction: ltr(nodirattribute set). Arabic renders via the browser's inherent bidi handling, but the field itself is not RTL-aware, so alignment and caret behaviour are LTR.Suggestion
Set
dir="rtl"(ordir="auto") on the ML control's inputs/editors when the active locale is RTL. This likely needs:is_rtlflag on theLocalemodel, or a lookup by language code), anddiron the active field when the locale changes.This is an enhancement / accessibility gap rather than a regression — RTL has never been handled — but it's a real barrier for RTL-language sites.