RFR: 8312075: FileChooser.win32.newFolder is not updated when changing Locale

Phil Race prr at openjdk.org
Fri Aug 4 18:37:36 UTC 2023


On Fri, 4 Aug 2023 13:03:14 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> src/java.desktop/share/classes/sun/swing/FilePane.java line 1595:
>> 
>>> 1593:                     String newFolderText = UIManager.getString(FilePane.ACTION_NEW_FOLDER,
>>> 1594:                             getFileChooser().getLocale());
>>> 1595:                     putValue(Action.ACTION_COMMAND_KEY, newFolderText);
>> 
>> I doubt this is the right thing to do. `ACTION_COMMAND_KEY` aren't localisable as far as I can see, and it makes perfect sense — they identify internal names of the commands.
>> 
>> The tooltip of the command and the created folder name are localisable.
>> 
>> If I run SwingSet2 in German locale, it works as expected: the tooltip of the New folder command is displayed in German (as the entire interface of `JFileChooser`) and the created folder has German name.
>> 
>> Start SwingSet2 with this command:
>> 
>> 
>> java -Duser.language=de -Duser.country=DE -jar /SwingSet2.jar
>
> I can see French resource files: [`windows_fr.properties`](https://github.com/openjdk/jdk/blob/e8a37b90db8dca4dc3653970b2d66d2faf8ef452/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties); the resources may not be included in the built JDK though.
> 
> I remember translations were removed, some were added back later.

Changing locale mid-application isn't something that seems like a good idea.
Is that really what they want - not sure the test is exactly about that.
Really I'm quite unclear as to whether the complaint is that some custom resource bundle isn't being used, or that there appears to be no FR localisation, or what ?

And if a Alexey says the change is renaming an internal action command string that seems odd.

I think this needs a better understanding to start with of what localisation support we have, and how it is being incorporated into the build and whether its being done as intended. 

After that is sorted we can ask for clarification as to what they really want to do.
I'm not sure this change will even help them, right or wrong.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15069#discussion_r1284731419



More information about the client-libs-dev mailing list