Skip to content

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

Description

@LukeTowers

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions