문제

How can this be achieved? I have the ff. test code:

javax.swing.JOptionPane.showMessageDialog(null, "Hello, world!");

Running it with, say, -Duser.language=zh and -Duser.country=TW doesn't work. I.e., the OK button is still labeled "OK". In Windows, for example, it is replaced with the Traditional Chinese equivalent.

도움이 되었습니까?

해결책

Prioritize the corresponding language in System Preferences > International.

Aqua is used if the LAF isn't specified. It doesn't respect the default locale probably because it's very much integrated into the OS.

If a cross-platform LAF is used (e.g., Metal), the problem is not observed.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top