Bug 546110 - FileDialog Cancel/OK not localized on Linux
Summary: FileDialog Cancel/OK not localized on Linux
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.11   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.12 M3   Edit
Assignee: Xi Yan CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2019-04-04 07:10 EDT by Timo Katajamaki CLA
Modified: 2019-05-21 15:00 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timo Katajamaki CLA 2019-04-04 07:10:38 EDT
FileDialog displays "Cancel" and "OK" buttons on Linux x86_64 / GTK3 even though rest of the app obeys localizations.

Rest of the dialog (like Downloads/Images etc. folders on the left) seem to be localized with the native content and language.



Behaviour is the same on Debian 8:

ii  libgtk-3-0:amd64                      3.14.5-1+deb8u1                      amd64        GTK+ graphical user interface library
ii  libgtk-3-bin                          3.14.5-1+deb8u1                      amd64        programs for the GTK+ graphical user interface library
ii  libgtk-3-common                       3.14.5-1+deb8u1                      all          common files for the GTK+ graphical user interface library

And on Debian 9:

ii  libgtk-3-0:amd64                      3.22.11-1                             amd64        GTK+ graphical user interface library
ii  libgtk-3-bin                          3.22.11-1                             amd64        programs for the GTK+ graphical user interface library
ii  libgtk-3-common                       3.22.11-1                             all          common files for the GTK+ graphical user interface library
Comment 1 Timo Katajamaki CLA 2019-04-04 07:14:25 EDT
Looking at FileDialog source code the dialog uses 
 GTK.GTK_NAMED_LABEL_OK 
and 
 GTK.GTK_NAMED_LABEL_CANCEL 

for the labels.

public static final byte[] GTK_NAMED_LABEL_OK = OS.ascii("_OK");
public static final byte[] GTK_NAMED_LABEL_CANCEL = OS.ascii("_Cancel");


Rest of the apps on linux display these buttons correctly localized (like Gedit -> Open file, IceWeasel -> File -> Open file) and so on.


If anyone knows a way to circumvent this by setting some linux / java / osgi variable or making a specific call to GTK, any information would be appreciated.
Comment 2 Eric Williams CLA 2019-04-04 08:58:51 EDT
Which language did you use to test this?
Comment 3 Timo Katajamaki CLA 2019-04-04 09:16:30 EDT
(In reply to Eric Williams from comment #2)
> Which language did you use to test this?

I have only used Finnish. Behaviour is the same in Eclipse IDE and in RCP App built on Eclipse.

The labels in Finnish should probably be: Peruuta / OK

The labels are correct on Eclipse 4.8 in GTK2 , but not on GTK3.

No localization on Eclipse 4.11 on GTK3 and GTK2 is no longer supported.

:~$ locale
LANG=fi_FI.utf8
LANGUAGE=
LC_CTYPE="fi_FI.utf8"
LC_NUMERIC="fi_FI.utf8"
LC_TIME="fi_FI.utf8"
LC_COLLATE="fi_FI.utf8"
LC_MONETARY="fi_FI.utf8"
LC_MESSAGES="fi_FI.utf8"
LC_PAPER="fi_FI.utf8"
LC_NAME="fi_FI.utf8"
LC_ADDRESS="fi_FI.utf8"
LC_TELEPHONE="fi_FI.utf8"
LC_MEASUREMENT="fi_FI.utf8"
LC_IDENTIFICATION="fi_FI.utf8"
LC_ALL=
Comment 4 Eric Williams CLA 2019-04-04 09:20:01 EDT
(In reply to Timo Katajamaki from comment #3)
> (In reply to Eric Williams from comment #2)
> > Which language did you use to test this?
> 
> I have only used Finnish. Behaviour is the same in Eclipse IDE and in RCP
> App built on Eclipse.
> 
> The labels in Finnish should probably be: Peruuta / OK
> 
> The labels are correct on Eclipse 4.8 in GTK2 , but not on GTK3.
> 
> No localization on Eclipse 4.11 on GTK3 and GTK2 is no longer supported.
> 
> :~$ locale
> LANG=fi_FI.utf8
> LANGUAGE=
> LC_CTYPE="fi_FI.utf8"
> LC_NUMERIC="fi_FI.utf8"
> LC_TIME="fi_FI.utf8"
> LC_COLLATE="fi_FI.utf8"
> LC_MONETARY="fi_FI.utf8"
> LC_MESSAGES="fi_FI.utf8"
> LC_PAPER="fi_FI.utf8"
> LC_NAME="fi_FI.utf8"
> LC_ADDRESS="fi_FI.utf8"
> LC_TELEPHONE="fi_FI.utf8"
> LC_MEASUREMENT="fi_FI.utf8"
> LC_IDENTIFICATION="fi_FI.utf8"
> LC_ALL=

Okay thanks. We'll investigate for 4.12.
Comment 5 Eclipse Genie CLA 2019-04-11 11:28:40 EDT
New Gerrit change created: https://git.eclipse.org/r/140439
Comment 7 Xi Yan CLA 2019-04-12 16:33:49 EDT
(In reply to Eclipse Genie from comment #6)
> Gerrit change https://git.eclipse.org/r/140439 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=28e336adcf0f34b6bd479c0532196521425137a3

In master now.
Comment 8 Eric Williams CLA 2019-05-21 15:00:25 EDT
Verified in I20190521-0600.