Grasscutters / Grasscutter

A server software reimplementation for a certain anime game.
https://grasscutter.io/
GNU Affero General Public License v3.0
16.24k stars 4.48k forks source link

[Issue] System language does not start the emulator #654

Closed Spellfox closed 2 years ago

Spellfox commented 2 years ago

After the last update whoever tries to start the emulator clean the first time, when generating the config.json file if your system language is not English you get the following error and the cmd closes right away,

2022-05-07T20:21:31Z - Failed to load language file: pt-BR.json java.lang.NullPointerException: null at java.base/java.io.Reader.<init>(Reader.java:168) at java.base/java.io.InputStreamReader.<init>(InputStreamReader.java:112) at emu.grasscutter.utils.Utils.readFromInputStream(Utils.java:258) at emu.grasscutter.utils.Language.<init>(Language.java:55) at emu.grasscutter.utils.Language.getLanguage(Language.java:22) at emu.grasscutter.Grasscutter.loadLanguage(Grasscutter.java:158) at emu.grasscutter.Grasscutter.<clinit>(Grasscutter.java:63) in some of the previous versions a language folder with two files was generated and now it is no longer generated when starting the emulator for the first time.

changing the config.json file as follows, it works again, original "LocaleLanguage": "pt_BR", "DefaultLanguage": "en",

modified "LocaleLanguage": "en_US", "DefaultLanguage": "en_US",

SunshineVX commented 2 years ago

They integrated the language files into the package.It seems to have some bugs.

zakhildev commented 2 years ago

It's no surprise that selecting language which isn't supported raises an error. However I think that it should be handled by switching to English for example.

Edit: I have just checked on it. Already fixed in this commit on the development branch