WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 2 years 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:
PR Number:

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 8 years ago.
19598.2.diff (4.0 KB) - added by georgestephanis 8 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 8 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 (23)

#1 @ramiy
8 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).

#2 @georgestephanis
8 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.

#3 @georgestephanis
8 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.

@georgestephanis
8 years ago

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

#4 follow-up: @georgestephanis
8 years ago

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

@georgestephanis
8 years ago

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

#5 in reply to: ↑ 4 ; follow-up: @azaozz
8 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).

#6 in reply to: ↑ 5 @ramiy
8 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.

#7 @yoavf
8 years ago

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

#8 @RanYanivHartstein
8 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

#9 @nacin
8 years ago

In [19816]:

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

#10 @nacin
8 years ago

In [19817]:

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

#11 @nacin
8 years ago

In [19818]:

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

#12 @nacin
8 years ago

In [19819]:

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

#13 @nacin
8 years ago

In [19820]:

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

#14 @nacin
8 years ago

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

#15 @ramiy
8 years ago

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

#16 @nacin
8 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.

#17 @nacin
8 years ago

In [19835]:

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

#18 @nacin
7 years ago

#19060 was marked as a duplicate.

This ticket was mentioned in Slack in #polyglots by sergey. View the logs.


2 years ago

This ticket was mentioned in Slack in #core-i18n by sergey. View the logs.


2 years ago

Note: See TracTickets for help on using tickets.