Bug 310834 - [BiDi] Something swaps around Compare Editor labels
Summary: [BiDi] Something swaps around Compare Editor labels
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on: 306751 307307
Blocks:
  Show dependency tree
 
Reported: 2010-04-28 10:36 EDT by Szymon Brandys CLA
Modified: 2019-09-01 14:08 EDT (History)
10 users (show)

See Also:


Attachments
Screenshot 1 (19.83 KB, image/png)
2010-04-28 10:37 EDT, Szymon Brandys CLA
no flags Details
The string that is set on the label (15.48 KB, image/png)
2010-04-28 10:43 EDT, Szymon Brandys CLA
no flags Details
The label when the Hebrew lang pack is installed (4.20 KB, image/png)
2010-04-28 10:48 EDT, Szymon Brandys CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Szymon Brandys CLA 2010-04-28 10:36:11 EDT
This is an issue I could observe while working on Bug 306641. I'll attach screenshots.
Comment 1 Szymon Brandys CLA 2010-04-28 10:37:04 EDT
Created attachment 166321 [details]
Screenshot 1
Comment 2 Szymon Brandys CLA 2010-04-28 10:41:05 EDT
I run Eclipse using these arguments -nl iw -nlExtensions "@calendar=hebrew". However the Hebrew lang pack is not installed. On Screenshot 1, you can see the result of comparing revisions. I marked the confusing label.
Comment 3 Szymon Brandys CLA 2010-04-28 10:43:30 EDT
Created attachment 166324 [details]
The string that is set on the label
Comment 4 Szymon Brandys CLA 2010-04-28 10:47:43 EDT
For me the fact that the date was swapped around looks wrong. I would expect to see the String in the label as it is, or something like 
[hebrew date] a.txt :Local history

When I install the language pack, the label looks ok.
Comment 5 Szymon Brandys CLA 2010-04-28 10:48:43 EDT
Created attachment 166328 [details]
The label when the Hebrew lang pack is installed
Comment 6 Eric Moffatt CLA 2010-04-28 14:51:44 EDT
Szymon, any idea who I should direct this defect to? It might be either the compare or BiDi related.
Comment 7 Paul Webster CLA 2010-04-28 15:09:26 EDT
Sorry, Eric, this is for BiDi.  TextProcessor scrambles the date as returned from the ICU calendar.  We worked around that by only applying TextProcessor to the file name.

Now in the actual widget, if we only have English NL packs with a Hebrew date it looks incorrect.  If we're using the Hebrew NL packs with the Hebrew date it looks fine.

It might just be that the property in English includes "Local History: ${0}" but in Hebrew the property includes "${0} :<HebrewCharacters>"

PW
Comment 8 Dina Sayed CLA 2010-05-06 08:28:24 EDT
The behavior described in screen shot 1 is expected when using mixed English and Hebrew text.
You can verify this by doing the following:-
open a text file with notepad on windows OS and write the following (with the same order from left)

Local history : a.txt <hebrew date or any hebrew characters>

after doing that press right ctrl+shift to mirror the notepad , now you will notice the same display seen in screen shot 1
This didn't happen when using the hebrew translated version which is understood as reading order won't change for LTR or RTL screen (because the whole text is in hebrew)
so to reach the desired order (which is <hebrew date> a.txt : local history) i suggest inserting control character "RLM" after the colon for only the case where eclipse is mirrored in RTL
Comment 9 Tomer Mahlin CLA 2010-05-06 09:48:11 EDT
 A similar issue was reported in bug 307161 and a general approach was discussed in bug 306751. Instead of patching the PII for ALL languages in the properties files or/and adding control characters for specific scenarios in endless list of contexts in the code (in which problematic PII is loaded), the suggestion is to enforce the structure of PII with a placeholder for given message "on the fly" in one location (where all PII are loaded). 
  The problem is in fact that the structure of message (PII) with placeholder(s ) replaced by end user originated data (which might but not necessarily matches the language of the message), is not enforced. Thus the message appears differently based on the data replacing the placholder(s).

  The general approach is as follows:
1. The support is invoked only when Bidi is turned on for end user originated data (via -bidi flag). For more details please see bug 307307
2. For each specific loaded message with placeholders (i.e. "hello {0} world: {1}) we identify the language of the message (PII).
3. Based on the language we derive the natural base text direction of the PII (on how to do that programatically please see comment #8 in bug 306751).
4. We parse out the message and inject Unicode control character(s) around the placeholders based on the identified language of PII.

  The key idea is that PII should be always displayed with natural to it base text direction regardless of GUI orientation. This means that for ALL LTR languages (i.e. English, Russian, etc.) the expected display is:
   local history: a.txt [hebrew date] 
independently from GUI orientation. It does not seem naturally to read English sentence from Right To Left: 
    [hebrew date] a.txt :local history
For all RTL languages (i.e. Arabic / Hebrew) we should expect to see:
    [hebrew date] a.txt :YROTSIH LACOL
Again, independently from GUI orientation.


 By the way, having mirrored GUI with English PII or not mirrored GUI with Hebrew PII is not a valid scenario. So, the originally reported problem in this bug is not valid assuming we are using the same data pattern. Namely, 
  In NOT mirrored GUI following text should be properly displayed:
    local history: a.txt [hebrew date] 
  In the mirrored GUI following text should also be properly displayed:
    LOCAL HISTORY: a.text [hebrew date]

 However, assuming Bidi characters are used for file name we might get the following problem:
   local history: FILENAME.EXT [hebrew date]
In NOT mirrored GUI we will get:
    local history: [hebrew date] TXE.EMANELIF
In mirrored GUI we will get: 
    [hebrew date] TXE.EMANELIF :local history

Bottom line is that I believe a general solution should be provided as part of fixing bug 306751
Comment 10 Eclipse Genie CLA 2019-09-01 14:08:04 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.