<AWT Dev> Review request for 8019280: CFileDialog selection button on choose directory mode should read " Choose "

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Tue Dec 8 19:28:45 UTC 2015

Hi, Avik.
I have checked it myself. Current implementation translate open button 
to other language.

Steps to reproduce:
  - change the preferred lang of the system
  - reboot
  - 8/8u60b31/bin/javac ./src/ValidateDirectorySelection.java
  - 8/8u60b31/bin/javapackager -createjar -srcdir src -outfile 
ValidateDirectorySelection.jar -appclass ValidateDirectorySelection
  - 8/8u60b31/bin/javapackager -deploy -native -outdir .  -outfile 
TEST.app -srcfiles ValidateDirectorySelection.jar -appclass 
ValidateDirectorySelection -name "TEST" -title "TEST"
  - open bundles/TEST.app
  - press on Directory Dialog and check the text on open button.

Note that it works this way because in Info.plist we have:

This is added automatically by javapackager because of:

Can you please check how it works after your fix?
Have you sent a request to the submitter to provide a guideline which 
was mentioned in the bug description?

On 26.11.15 8:10, Avik Niyogi wrote:
> Hi Semyon,
> Thank you for the quick response. Maybe we can discuss regarding this
> off the mail thread along with our team here and also with Sergey.
> With Regards,
> Avik Niyogi
>> On 25-Nov-2015, at 7:05 pm, Semyon Sadetsky
>> <semyon.sadetsky at oracle.com <mailto:semyon.sadetsky at oracle.com>> wrote:
>> Hi Avik,
>> The problem with this customized button text is that it does not
>> localized. If we do this change we will get a lot bugs from users that
>> use Mac with non-English locales because they will see "Choose" button
>> always.
>> You are correct there are no OSX resource bundles in Java.  In native
>> dialogs we rely on OS localization. So we need to find a way to
>> customize the button but according to the system locale, which may be
>> not easy.
>> I told to Sergey and he wonders why "Open" button is the default
>> system behavior while Apple issues recommendations to use "Choose"
>> button? Can you dig in this direction? It is possible, this bug should
>> not be fixed at all.
>> --Semyon
>> On 11/25/2015 7:57 AM, Avik Niyogi wrote:
>>> Hi All,
>>> Please find below the web rev with inputs from comments.
>>> http://cr.openjdk.java.net/~aniyogi/8019280/webrev.02/
>>> <http://cr.openjdk.java.net/%7Eaniyogi/8019280/webrev.02/>
>>> With Regards,
>>> Avik Niyogi
>>>> On 24-Nov-2015, at 5:16 pm, Avik Niyogi
>>>> <<mailto:avik.niyogi at oracle.com>avik.niyogi at oracle.com> wrote:
>>>> Hi Semyon,
>>>> I checked the rest of the JDK and found out that there is no
>>>> localisation bundle so there is no need for NSLocalizedString. I
>>>> will change that and create new webrev.
>>>> Trailing white space is used because the button size is not sufficient.
>>>> With Regards,
>>>> Avik Niyogi
>>>>> On 24-Nov-2015, at 4:03 pm, Semyon Sadetsky
>>>>> <semyon.sadetsky at oracle.com <mailto:semyon.sadetsky at oracle.com>> wrote:
>>>>> Hi Avik,
>>>>> Did you try to change the locale? Did button get the localized text
>>>>> then?
>>>>> Why do you use trailing white-spaces for the key?
>>>>> The second argument of NSLocalizedString should be a comment.
>>>>> Perhaps, it'd be better to write a key description there instead of
>>>>> repeating the key.
>>>>> --Semyon
>>>>> On 11/23/2015 9:34 AM, Avik Niyogi wrote:
>>>>>> Hi All,
>>>>>> Kindly review the fix for JDK9.
>>>>>> *Bug*:
>>>>>> https://bugs.openjdk.java.net/browse/JDK-8019280
>>>>>> *Webrev*:
>>>>>> http://cr.openjdk.java.net/~aniyogi/8019280/webrev.00/
>>>>>> <http://cr.openjdk.java.net/%7Eaniyogi/8019280/webrev.00/>
>>>>>> *Issue*: The OpenJDK implementation of CFileDialog for mac is
>>>>>> inconsistent with how Apple's implementation would show the
>>>>>> selection button when the dialog was set to choose directories.
>>>>>> Expected correct caption on the selection button should be "
>>>>>> Choose " , not " Open " according to Mac OSX UI guidelines.
>>>>>> *Cause*: Incorrect implementation within CFileDialog.m
>>>>>> *Fix*:Added logic to setPrompt when opening a directory selection
>>>>>> File Dialog
>>>>>> With Regards,
>>>>>> Avik Niyogi

Best regards, Sergey.

More information about the awt-dev mailing list