wintercms / wintercms/wn-translate-plugin
ML form controls don't apply RTL text direction when editing right-to-left locales
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 17
- Forks
- 20
- Avg merge
- 9h 43m
- Merged PRs (30d)
- 2
Description
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), plusar(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 toar. - 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_rtlflag on theLocalemodel, or a lookup by language code), and - the ML partials + the locale-switch JS to toggle
diron 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ML partials, the locale-switch JavaScript, and the Locale model to trace how the active locale reaches each input, textarea, or editor. Confirm the RTL locale source and update behavior by reproducing the Arabic case; done means active RTL fields receive dir="rtl" and switching locales updates direction consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php
- Domain
- accessibility, frontend, internationalization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100