Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: Add Unicode escape sequence conversion feature #250

Merged
merged 6 commits into from
Jun 11, 2024

Conversation

Sunshine-Planet
Copy link
Contributor

and update Chinese language.

seems like it work for escape sequence and utf8 char in my test.

@mmdanggg2
Copy link
Collaborator

Mostly looks good, I'm seeing a couple of NPEs when starting up when set to english though.

java.lang.NullPointerException
	at java.io.Reader.<init>(Reader.java:78)
	at java.io.InputStreamReader.<init>(InputStreamReader.java:113)
	at org.jmc.util.Messages$UTF8Control.newBundle(Messages.java:39)
	at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1518)
	at java.util.ResourceBundle.findBundle(ResourceBundle.java:1482)
	at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1370)
	at java.util.ResourceBundle.getBundle(ResourceBundle.java:824)
	at org.jmc.util.Messages.<clinit>(Messages.java:16)
	at org.jmc.gui.Settings.<init>(Settings.java:73)
	at org.jmc.gui.MainWindow.<init>(MainWindow.java:55)
	at org.jmc.Main.runGUI(Main.java:65)
	at org.jmc.Main.main(Main.java:47)

Looks like it's trying to load messages_en.properties which doesn't exist. According to the documentation for newBundle, I think you should specifically check if it exists and return null if not and then just let any IOExceptions be handled further up the stack.

Sunshine-Planet and others added 2 commits June 11, 2024 11:43
Co-authored-by: James Horsley <mmdanggg2@users.noreply.github.com>
@mmdanggg2 mmdanggg2 merged commit e30362b into jmc2obj:master Jun 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants