Last Comment Bug 668960 - [RTL] Scratchpad JavaScript editor should be LTR
: [RTL] Scratchpad JavaScript editor should be LTR
Status: VERIFIED FIXED
: rtl
Product: Firefox
Classification: Client Software
Component: Developer Tools (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Simon Montagu :smontagu
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-02 01:02 PDT by Tomer Cohen :tomer
Modified: 2011-07-18 01:03 PDT (History)
8 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+
fixed
+
fixed


Attachments
screenshot (36.76 KB, image/png)
2011-07-02 01:17 PDT, Tomer Cohen :tomer
no flags Details
Make the textbox left-to-right (1.01 KB, patch)
2011-07-05 13:01 PDT, Simon Montagu :smontagu
mihai.sucan: review+
asa: approval‑mozilla‑aurora+
asa: approval‑mozilla‑beta+
Details | Diff | Review

Description Tomer Cohen :tomer 2011-07-02 01:02:15 PDT
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
Comment 1 Tomer Cohen :tomer 2011-07-02 01:17:24 PDT
Created attachment 543583 [details]
screenshot
Comment 2 Rob Campbell [:rc] (:robcee) 2011-07-05 07:59:53 PDT
this is not good.

Since this is just a text area, can we force it to run as LTR all the time?
Comment 3 Tomer Cohen :tomer 2011-07-05 08:15:27 PDT
(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.
Comment 4 Tomer Cohen :tomer 2011-07-05 08:18:46 PDT
(In reply to comment #3)
> switching text direction (ctrl-shift-x) is somehow missing from this
> textarea.
see Bug 669011
Comment 5 Simon Montagu :smontagu 2011-07-05 13:01:25 PDT
Created attachment 544034 [details] [diff] [review]
Make the textbox left-to-right
Comment 6 Asa Dotzler [:asa] 2011-07-05 14:41:00 PDT
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 7 Mihai Sucan [:msucan] 2011-07-06 03:07:54 PDT
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.
Comment 8 Simon Montagu :smontagu 2011-07-06 06:34:00 PDT
(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.
Comment 9 Simon Montagu :smontagu 2011-07-06 06:34:30 PDT
http://hg.mozilla.org/mozilla-central/rev/4e151ddc06c0
Comment 10 Simon Montagu :smontagu 2011-07-06 06:35:55 PDT
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.
Comment 11 Rob Campbell [:rc] (:robcee) 2011-07-06 06:47:50 PDT
thanks for the quick patch, Simon!
Comment 13 Alex Lakatos[:AlexLakatos] 2011-07-18 01:03:12 PDT
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

Note You need to log in before you can comment on or make changes to this bug.