Bug 355208 - Button text disappears in Arabic/Hebrew
Summary: Button text disappears in Arabic/Hebrew
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: Macintosh Mac OS X
: P3 trivial (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2011-08-19 08:00 EDT by Anirudh Sasikumar CLA
Modified: 2019-10-10 17:04 EDT (History)
8 users (show)

See Also:


Attachments
Screenshot showing the bug (94.83 KB, image/png)
2011-08-19 08:01 EDT, Anirudh Sasikumar CLA
no flags Details
Another screenshot of Help view in Arabic locale (15.64 KB, image/png)
2011-09-07 00:43 EDT, Praveen CLA
no flags Details
Simple RCP to recreate the scenario (15.76 MB, application/octet-stream)
2011-09-21 10:05 EDT, Praveen CLA
no flags Details
Packaged SWT Application (1.97 MB, application/octet-stream)
2011-09-22 11:30 EDT, Praveen CLA
no flags Details
SWT Snippet (1.33 KB, application/octet-stream)
2011-10-05 10:12 EDT, Praveen CLA
no flags Details
Arabic Language preference page (262.43 KB, image/png)
2011-10-17 10:41 EDT, Praveen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anirudh Sasikumar CLA 2011-08-19 08:00:07 EDT
Build Identifier: 20110615-0604

The default text that appears when no launch configuration is selected has pieces missing if the default language is Arabic / Hebrew.

This is only present in Eclipse 3.7, not in 3.6.

Reproducible: Always

Steps to Reproduce:
1. Go to System Preferences -> Language and Text -> Find hebrew in the list (click on edit list if not present) and drag that to the top.
2. Start Eclipse.
3. Go to debug as -> Debug configurations

Look at the launch config dialog. It has text clipped out in the middle with only icons appearing. (Screenshot attached)

This is only on Mac (10.6.x).
Comment 1 Anirudh Sasikumar CLA 2011-08-19 08:01:38 EDT
Created attachment 201779 [details]
Screenshot showing the bug
Comment 2 Praveen CLA 2011-09-07 00:43:22 EDT
Created attachment 202855 [details]
Another screenshot of Help view in Arabic locale

The same problem is visible with various other views as well, in fact across entire workbench. For example, the Help view appears blank with out any text. Similar behavior is seen with Plug-in Manifest editor as well.
Comment 3 Praveen CLA 2011-09-20 03:01:04 EDT
It appears that Eclipse 3.6 works well in Arabic/Hebrew environment - all the strings and links are visible without any problem. The problem has cropped up from Eclipse 3.7 as many views/pages exhibit missing strings and links.

I tried to create a simple RCP app with CLabel that is set with an image and text. When it is run against Arabic/Hebrew environment, the text of CLabel is not displayed. Assigning to SWT as the problem appears at the SWT components level.
Comment 4 Felipe Heidrich CLA 2011-09-20 10:19:25 EDT
Hi Praveen,

can you attach a simple swt snippet to this bug showing the problem ?
will any CLabel displaying text+image have the problem ?

thank you
Comment 5 Praveen CLA 2011-09-21 10:05:51 EDT
Created attachment 203771 [details]
Simple RCP to recreate the scenario

Felipe, I already recreating the scenario through a simple SWT snippet. Unfortunately, when the snippet is executed in Eclipse, the launched snippet is not started in Arabic/Hebrew environment. Same is the case for self-hosted eclipse. (looks like Eclipse launcher failing to launch Java code in Arabic env)
That's the reason I have mentioned to use a simple RCP application for recreating the scenario. Please find the attached sample RCP application that exhibits the missing text of CLabel in Arabic environment.
Comment 6 Praveen CLA 2011-09-22 11:30:47 EDT
Created attachment 203848 [details]
Packaged SWT Application

Felipe, Further to my previous attachment, I have created a packaged simple SWT application that contains the CLabel with image and text.

When the app is run against default environment (en_US), everything works without any issues. However, when it is run against Arabic/Hebrew (ar_EG), the text of CLabel goes missing. The same is the case for certain links as I have posted in one of the screenshots of Help page.

Please let me know if you need additional information.
Comment 7 Praveen CLA 2011-09-28 13:55:40 EDT
Felipe, Are you aware of any quick workaround/fix for this problem ?
Comment 8 Felipe Heidrich CLA 2011-10-03 12:06:06 EDT
Can you reproduce the problem using just a SWT snippet ?
If so, what happens if you try to use a GC or a TextLayout to draw the string ?
Comment 9 Praveen CLA 2011-10-05 08:34:41 EDT
(In reply to comment #8)
> Can you reproduce the problem using just a SWT snippet ?
> If so, what happens if you try to use a GC or a TextLayout to draw the string ?

Felipe, the previous attachment is a simple SWT snippet itself, just that it is packaged so that it will run in Arabic env on Mac Arabic.

While I was trying to reproduce the use-case using drawText() API I have narrowed down the problem to a particular style bit that is causing the problem. The widget CLabel uses DRAW_FLAGS style to draw the text - which is a combination of all the draw style bits. In this case, the text is missing in Arabic env.

If I draw the same text using all draw style bits excluding SWT.DRAW_TAB, then the text appears pretty well in Arabic env. Even the text of links appears now. The only place that makes use of this flag is in GC.createString() - so I tried setting the paragrathStyle irrespective of the usage of DRAW_TAB flag. Then, everything appears without any problems.

I tried differentiating the GC class source code between 3.6 against 3.7 version - there aren't any significant changes in this specific area. May be, you can shed some light as to ascertain what could have triggered this problem from 3.7 version.

Please let me know if you need additional information. Thanks.
Comment 10 Felipe Heidrich CLA 2011-10-05 09:26:17 EDT
(In reply to comment #9)

> Please let me know if you need additional information. Thanks.

Yes, please send me a SWT snippet (1 java file, hopefully with just a main method in it).
I need to be able to reproduce the bug in my workspace (so I can debug and modify the code). Your last attachment is not good for that.
Comment 11 Praveen CLA 2011-10-05 10:12:43 EDT
Created attachment 204595 [details]
SWT Snippet

Attached is the SWT code snippet of the packaged SWT App (in the previous attachment) to recreate the problem scenario.
When this is run on Mac in Arabic mode, the text of CLabel is missing. When I tried executing Java classes in Eclipse, it does not launch the snippet in Arabic mode though the target platform is set to it and the program arguments are set to 'ar_EG'. It looks like a bug to me in the Eclipse launcher code as it is failing to launch the snippet in arabic mode.
Comment 12 Praveen CLA 2011-10-07 06:49:46 EDT
This problem is cropped up due to the code changes of bug 298698 (https://bugs.eclipse.org/bugs/attachment.cgi?id=179348&action=diff) especially in GC.java class.

Once I have reverted back the code of GC.createLayout() function to

size.width = Float.MAX_VALUE;
size.height = Float.MAX_VALUE;

the links and CLabel are properly displaying strings without any problems in Arabic/Hebrew environment.
Comment 13 Felipe Heidrich CLA 2011-10-07 11:42:46 EDT
First, can you attach of picture of your language and text preference page selecting the arabic language.
I have about 4 scripts that look like 'arabic' but I'm not quite sure which one to pick.
I tried one of them but I was not able to reproduce the bug, not with the snippet nor with the application.

Praveen, I would like to know why you can't reproduce the problem with the snippet.
Can you go back to English locale and try to use the SWT.RIGHT_TO_LEFT flag ? For example:
Change the snippet to start with these lines:
System.out.println(System.getProperty("user.language"));
int style = SWT.SHELL_TRIM;
style |= SWT.RIGHT_TO_LEFT;
Display display = new Display();
Shell shell = new Shell(display, style);

Try to force locale to arabic, start java using:
-Duser.country=EG -Duser.language=ar 

Or change the LANG env variable to ar_EG

I noticed that in my system, running locale -a in a terminal, it does not have any arabic locale, what do you get in your system and you run locale and 'locale -a | grep ar' in a terminal ?
Comment 14 Praveen CLA 2011-10-17 10:41:58 EDT
Created attachment 205337 [details]
Arabic Language preference page

Felipe, Find the attached preference page that contains the Arabic language preference at top of the list.

I already tried using SWT.RIGHT_TO_LEFT flag in the SWT snippet with no luck. Also, forcing the language to arabic using -Duser.country flags, or through LANG environment variable does not help.
Even my terminal does not show arabic locale for 'locale -a' command, though there were the preference settings of Terminal does show MacArabic encoding. May be, this should explain why Eclipse was unable to launch Java application in Arabic locale.
Comment 15 Lakshmi P Shanmugam CLA 2017-07-03 05:00:23 EDT
Bug triaged, visit https://wiki.eclipse.org/SWT/Devel/Triage for more
information.
Comment 16 Eclipse Genie CLA 2019-10-10 17:04:12 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.