WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 19 months ago

#19598 closed task (blessed) (fixed)

Text inputs for code or URLs should be LTR

Reported by: nacin Owned by: georgestephanis
Milestone: 3.4 Priority: normal
Severity: normal Version:
Component: I18N Keywords: rtl-feedback has-patch
Focuses: Cc:

Description

Various options fields need to be LTR. Some locales (well, at least ug_CN) hardcode these as LTR:

  • upload_url_path and upload_path on options-media.php
  • mailserver_url, mailserver_login, and mailserver_pass on options-writing.php
  • Functions in the docs-list select box on plugin-editor.php and theme-editor.php
  • admin_email, new_admin_email, home, siteurl on options-general.php

If some RTL languages believe these should be RTL (URLs in particular, I'm curious about), we need to know.

Attachments (3)

19598.diff (2.3 KB) - added by georgestephanis 2 years ago.
19598.2.diff (4.0 KB) - added by georgestephanis 2 years ago.
Revised patch, tidying up/unifying how it does ltr for the code editor textareas.
19598.3.diff (4.7 KB) - added by georgestephanis 2 years ago.
Patch with revision to class-wp-editor.php to add code class to the wp-editor textarea to make it ltr.

Download all attachments as: .zip

Change History (21)

comment:1 ramiy2 years ago

In RTL languages (hebrew and arabic) regular input[type="text"] have to be RTL (because the text is in local language), but when the input used for URL or the textarea used for code, it should be LRT (because the code is in english).

comment:2 georgestephanis2 years ago

  • Cc George@… added
  • Owner set to georgestephanis
  • Status changed from new to accepted

input.code { direction: ltr; }

I'm patching it (or something similar) into the rtl css now.

georgestephanis2 years ago

comment:3 georgestephanis2 years ago

  • Keywords has-patch added

I had to add the code class to an input field or three, and just hit the doc functions list by its existing id. But it looks good now -- my only concern would be that there is some other input.code that it shouldn't hit -- but if it has .code, it should? Anyway, patch attached.

georgestephanis2 years ago

Revised patch, tidying up/unifying how it does ltr for the code editor textareas.

comment:4 follow-up: georgestephanis2 years ago

Should the html side of the wp_editor output also be LTR?

georgestephanis2 years ago

Patch with revision to class-wp-editor.php to add code class to the wp-editor textarea to make it ltr.

comment:5 in reply to: ↑ 4 ; follow-up: azaozz2 years ago

Replying to georgestephanis:

Should the html side of the wp_editor output also be LTR?

That's an interesting question. It is for HTML code but is also used as a "normal" text entry field. Perhaps we need more comments from native RTL language speakers :)

Another option would be to have RTL toggle button similar to the visual editor (that would toggle it for the whole textarea).

comment:6 in reply to: ↑ 5 ramiy2 years ago

Replying to azaozz:

Replying to georgestephanis:

Should the html side of the wp_editor output also be LTR?

Perhaps we need more comments from native RTL language speakers :)

When i swich to HTML mode, i prefer to see the content in RTL.

Unlike theme/plugin editor, that was mostly code, in wp-editor most of the content is a text in my local language, with a few HTML tags. This is why it shold stay in RTL, as it is today.

The "RTL toggle button" in the visual editor is also a good idea.

comment:7 yoavf2 years ago

We already have #13070 for the RTL toggle button for the HTML editor. :)

comment:8 RanYanivHartstein2 years ago

I would also suggest that the user name should always be LTR.

I too would prefer the HTML editor to default to RTL and let me easily switch to LTR as in #13070

comment:9 nacin2 years ago

In [19816]:

Code is still code: force LTR for .code and <code>, and the function lists in plugin/theme editors. see #19598.

comment:10 nacin2 years ago

In [19817]:

New .ltr class for forcing elements to be LTR when using an RTL language. see #19598.

comment:11 nacin2 years ago

In [19818]:

mailserver_login and mailserver_pass should always be LTR. see #19598.

comment:12 nacin2 years ago

In [19819]:

Use existing string to properly translate month + year combo. see #19598.

comment:13 nacin2 years ago

In [19820]:

Translate the monthnum/month abbreviation construct in the Publish box. see #19598.

comment:14 nacin2 years ago

Still need a verdict on the user_login field, and whether that applies to user-edit.php or also wp-login.php.

comment:15 ramiy2 years ago

The user_login field should be LTR. This field is in english, it can't be RTL.

comment:16 nacin2 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In [19834]:

LTR for user-edit.php password fields and disabled user_login field. fixes #19598.

comment:17 nacin2 years ago

In [19835]:

In general, password fields should always be LTR. see #19598.

comment:18 nacin19 months ago

#19060 was marked as a duplicate.

Note: See TracTickets for help on using tickets.