hope366 / Lizzie-improvements

Lizzie - Leela Zero Interface
GNU General Public License v3.0
30 stars 9 forks source link

Get 4 menu items from resourceBundle. #6

Closed wonsiks closed 3 years ago

wonsiks commented 3 years ago

Menu.game.scoreGame Menu.analyze.rule Menu.help Menu.help.keyboardControls

hope366 commented 3 years ago

I manage Lizzie-improvements, but I know very little about programming. Can you tell me what these three pull requests mean?

wonsiks commented 3 years ago

@hope366 Current source code : Display names are hard coded in the source file(Menu.java) Changed code : Real display names are defined in resource files and call them from source file so that the menus can be written in various languages.(English, Japanese, Korean, ...) I've just changed English and Korean language file and you can change Japanese by editing /src/main/resources/l10n/DisplayStrings_ja_JP.properties file. Untitled-1

hope366 commented 3 years ago

I see, that's a convenient mechanism ^^ I would like to change DisplayStrings_ja_JP.Properties, Where can I find something like "u30c9"?

wonsiks commented 3 years ago

@hope366 .properties file uses unicode. So you need to convert Japanese language to unicode. You can convert your string from https://www.online-toolz.com/tools/text-unicode-entities-convertor.php After you get unicode then need to change % into \ then write it into .properties file. 20210113_155843

hope366 commented 3 years ago

Thank you for providing us with valuable information. I modified DisplayStrings_ja_JP.properties and compiled it. Apparently it worked ^^

wonsiks commented 3 years ago

@hope366 Cool... What about changing 'Clear analysis' too?

hope366 commented 3 years ago

Menu.java line 1293 new JMenuItem (resourceBundle.getString ("Menu.analyze.clearAnalysis ")); Since it is already like this, should I just change DisplayStrings_ja_JP.properties?

wonsiks commented 3 years ago

@hope366 Yes, just changing .properties file then it will work.

hope366 commented 3 years ago

Now all the display items are in Japanese ^^ Great!

wonsiks commented 3 years ago

@hope366 It's great!!! Congratulations...

hope366 commented 3 years ago

I've always wanted to know about Unicode. I am very happy to be able to do something new today. thank you very much.

wonsiks commented 3 years ago

@hope366 I'm happy to help you too...:)