wintercms / wintercms/wn-translate-plugin

ML form controls don't apply RTL text direction when editing right-to-left locales

Open
#116 0 comments 0 reactions 0 assignees View on GitHub

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), plus ar (enabled)
Steps to reproduce
  1. Add and enable an RTL locale such as ar.
  2. On any translatable field (e.g. mltext), click the field's locale button and switch to ar.
  3. Type/paste Arabic text.
  4. 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.