Modify

Opened 3 years ago

Last modified 8 days ago

#16163 new enhancement

Right To Left support for input boxes

Reported by: iman Owned by: iman
Priority: normal Milestone: 21.06
Component: Core Version:
Keywords: RTL bidirectional arabic Cc: aat765

Description

Currently the text we type in input boxes is Left-to-Right and left aligned by default. When writing in a RTL language like Persian, Arabic, etc it's better we have a RTL environment to type in.

For example on input boxes of this website we can switch between RTL and LTR text direction by pressing "right ctrl + shift" or "left ctrl + shift".

Such an ability is so useful for users who their language is RTL.

Attachments (6)

1.gif (17.1 KB) - added by iman 2 years ago.
sample.osm (285 bytes) - added by iman 2 years ago.
rtl_ltr_display.png (16.7 KB) - added by iman 2 years ago.
2.png (19.3 KB) - added by iman 2 years ago.
Screenshot 2021-04-09 at 21.21.56.png (127.6 KB) - added by simon04 2 months ago.
jp2launcher_RkVU9Ouoml.png (8.8 KB) - added by aat765 7 weeks ago.
arabic RTL

Download all attachments as: .zip

Change History (22)

comment:1 Changed 3 years ago by iman

Owner: changed from team to iman
Type: defectenhancement

Changed 2 years ago by iman

Attachment: 1.gif added

Changed 2 years ago by iman

Attachment: sample.osm added

Changed 2 years ago by iman

Attachment: rtl_ltr_display.png added

Changed 2 years ago by iman

Attachment: 2.png added

comment:2 Changed 2 years ago by iman

There's also another option: auto-switching direction and alignment based on first character of a word (Strong Left or Right character based on Unicode standards).

For example:
If I start typing "name", since it starts with "n", so the inputbox remains LTR and left-aligned.
Now I want to type a Persian name into the "value" inputbox, e.g. "خیابان سوم". Since this value starts with the RTL letter "خ" inputbox should be RTL and right-aligned.

Why this is important?
This reduces user confusion and prevent values such as "5 کوچه" (="5 Alley") instead of "کوچه 5" (="Alley 5"), because user see he is typing "Alley 5" but on display he gets "5 Alley", so he will manipulate it to get the proper display. There are more examples that some of them are even more complex that really can confuse users. Also maybe it reduce the usage of some invisible characters such as "right-to-left embeding" that forces the following string to be displayed RTL.

This gif shows what user gets while typing in a RTL script.

https://josm.openstreetmap.de/attachment/ticket/16163/1.gif

In the following screenshots you can see that the inputbox shows the string from left to right, while with the tags pane all is fine and it shows them correctly (similar to display on the map).

https://josm.openstreetmap.de/attachment/ticket/16163/2.png

https://josm.openstreetmap.de/attachment/ticket/16163/rtl_ltr_display.png

In case of RTL script, it's better to have right-alignment too, for the inputboxes. Because with left-alignment for a rtl string users get confused about start of the string: do it starts from the starting point of the inputbox, or from right side of the first letter? where he should click? You know, not all people are aware about Home/End keys or techniques of moving among text.

A Sample file used for screenshots.

Thanks

Last edited 2 years ago by iman (previous) (diff)

comment:3 Changed 2 years ago by Sosha

really 14 months ago and anyone don't respond to this issue?

literally this bug very very on my nerve. please someone resolv this issue.

comment:4 Changed 2 months ago by simon04

In 17730/josm:

see #16163 - MainApplication: apply component orientation based on locale

comment:5 Changed 2 months ago by simon04

In 17731/josm:

see #16163 - ExtendedDialog.setupDialog: apply component orientation from MainFrame

comment:6 Changed 2 months ago by simon04

In 17732/josm:

see #16163 - Prefer GridBagConstraints.LINE_START over GridBagConstraints.WEST

comment:7 Changed 2 months ago by simon04

In 17733/josm:

see #16163 - Prefer SwingConstants.LEADING over SwingConstants.LEFT

Changed 2 months ago by simon04

comment:8 Changed 2 months ago by simon04

In 17734/josm:

see #16163 - Fix SwingConstants.LEFT for PreferenceTabbedPane

comment:9 Changed 2 months ago by Don-vip

Milestone: 21.04

comment:10 Changed 2 months ago by simon04

In 17738/josm:

see #16163 - Fix NPE in unit tests

comment:11 Changed 7 weeks ago by simon04

Cc: aat765 added
Keywords: arabic added
Milestone: 21.0421.05

@iman, aat765, please report if things improved and whether this is the right way to go...

Changed 7 weeks ago by aat765

Attachment: jp2launcher_RkVU9Ouoml.png added

arabic RTL

comment:12 in reply to:  11 Changed 7 weeks ago by aat765

Replying to simon04:

@iman, aat765, please report if things improved and whether this is the right way to go...

https://josm.openstreetmap.de/attachment/ticket/16163/jp2launcher_RkVU9Ouoml.png

Thank you, yes it is working properly now for Arabic language.

comment:13 Changed 7 weeks ago by hubaishan

All tag keys are Latin script (LTR) so "key" text box must be (LTR) Left Aligned even if interface language is (RTL).

All tag values are Latin script (LTR) exept names and addresses in (RTL) languages (Arabic, Persian ...). So the best behavior is "value" textbox must be (LTR) Left Aligned even if interface language is (RTL) exept 2 cases value box must be right Aligned and (RTL):

  1. When the tag key is name in (RTL) language like (name:ar, name:fa, alt_name:ar...) even if interface language is (LTR).
  2. When interface language is (RTL) and tag is unlocaliesd name (name,alt_name) or address (addr:*).
Last edited 7 weeks ago by hubaishan (previous) (diff)

comment:14 Changed 5 weeks ago by iman

This way the problem still exists but in another form: User wants to type an English string, while text box is forced RTL.

I prefer a mechanism to switch direction of text inside input box based on user demand regardless of interface language.

For instance this is Notepad.exe on Windows with a button to switch text direction:

https://s18.picofile.com/file/8432913184/switch_reading_order_in_notepad_exe.gif

(Also with hotkey for rtl direction: right ctrl + shift and hotkey for ltr direction: left ctrl + shift)

Last edited 5 weeks ago by iman (previous) (diff)

comment:15 Changed 2 weeks ago by simon04

Milestone: 21.0521.06

comment:16 Changed 8 days ago by hubaishan

I am agree with Iman.
I see changing text direction by hot keys also seen in some Open-source Java programs like
http://docfetcher.sourceforge.net/en/index.html
The search textbox uses this feature

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain iman.
as The resolution will be set.
to The owner will be changed from iman to the specified user.
The owner will change to iman
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from iman to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.