Closed Bug 668960 Opened 13 years ago Closed 13 years ago

[RTL] Scratchpad JavaScript editor should be LTR

Categories

(DevTools :: General, defect)

defect
Not set
normal

Tracking

(firefox6+ fixed, firefox7+ fixed)

VERIFIED FIXED
Tracking Status
firefox6 + fixed
firefox7 + fixed

People

(Reporter: tomer, Assigned: smontagu)

Details

(Keywords: rtl)

Attachments

(2 files)

Since JavaScript Scratchpad is intended for code input, I'd suggest to override its direction for RTL languages, so it would be aligned to the left even when the UI is Arabic, Persian or Hebrew. 


As for l10n, this change would impact few strings, or more exactly the comment in the default empty Scratchpad. For Hebrew I've already included a fix for that so the comment will keep the text direction even if the textarea direction will be changed (using RLE..PDF for each line). 
http://hg.mozilla.org/releases/l10n/mozilla-aurora/he/annotate/febdf55b4e80/browser/chrome/browser/scratchpad.dtd#l122
http://hg.mozilla.org/releases/l10n/mozilla-aurora/he/annotate/febdf55b4e80/browser/chrome/browser/scratchpad.properties#l35
Version: 6 Branch → unspecified
Attached image screenshot
this is not good.

Since this is just a text area, can we force it to run as LTR all the time?
(In reply to comment #2)
> Since this is just a text area, can we force it to run as LTR all the time?
I am not sure if is actually 'just a text area', as the regular key binding for switching text direction (ctrl-shift-x) is somehow missing from this textarea.
(In reply to comment #3)
> switching text direction (ctrl-shift-x) is somehow missing from this
> textarea.
see Bug 669011
Assignee: nobody → smontagu
Attachment #544034 - Flags: review?(mihai.sucan)
Release drivers don't need to track this but we would be very open to taking a fix. When this patch is reviewed, please request approval on the patch for Beta [6].
Comment on attachment 544034 [details] [diff] [review]
Make the textbox left-to-right

This looks fine. Thank you!

I would've expected there is, like dir=ltr|rtl in HTML, an attribute on the xul:textbox element that we can use to change the language direction.
Attachment #544034 - Flags: review?(mihai.sucan) → review+
(In reply to comment #7)
> I would've expected there is, like dir=ltr|rtl in HTML, an attribute on the
> xul:textbox element that we can use to change the language direction.


XUL has a dir attribute, but it has different semantics. We did discuss possibly adding an attribute equivalent to HTML's dir in bug 548206.
http://hg.mozilla.org/mozilla-central/rev/4e151ddc06c0
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment on attachment 544034 [details] [diff] [review]
Make the textbox left-to-right

Asking approval for aurora and beta. This is a trivial and minimal-risk patch which will make a much better experience for Scratchpad users in RTL locales.
Attachment #544034 - Flags: approval-mozilla-beta?
Attachment #544034 - Flags: approval-mozilla-aurora?
thanks for the quick patch, Simon!
Attachment #544034 - Flags: approval-mozilla-beta?
Attachment #544034 - Flags: approval-mozilla-beta+
Attachment #544034 - Flags: approval-mozilla-aurora?
Attachment #544034 - Flags: approval-mozilla-aurora+
Verified on معرّف البناء: Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20100101 Firefox/6.0 and معرّف البناء: Mozilla/5.0 (X11; Linux i686; rv:7.0a2) Gecko/20110714 Firefox/7.0a2
Status: RESOLVED → VERIFIED
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: