Stekeblad / Stekeblads-Video-Uploader

Easier bulk-uploading to Youtube
MIT License
31 stars 13 forks source link

System language bug #11

Closed ye-yu closed 4 years ago

ye-yu commented 4 years ago

When I first run this program, the following error is printed out into the console"

Could not find a matching or partially matching translation for baseStrings and en_us
Could not find a matching or partially matching translation for locCatWindow and en_us
Could not find a matching or partially matching translation for mainWindow and en_us
Could not find a matching or partially matching translation for manPlayWindow and en_us
Could not find a matching or partially matching translation for meta and en_us
Could not find a matching or partially matching translation for presetWindow and en_us
Could not find a matching or partially matching translation for presetsUploads and en_us
Could not find a matching or partially matching translation for settingsWindow and en_us
Could not find a matching or partially matching translation for toolMetaData and en_us
Could not find a matching or partially matching translation for uploader and en_us

When I click on Settings, the dropdown for language setting is empty. When clicking close, an error dialog is popped out with the following message:

Sorry, something went wrong!
Here is the error details:
-----------------------------------------
null
-----------------------------------------
java.lang.NullPointerException
    at io.github.stekeblad.videouploader.utils.translation.TranslationsMeta.langNameToLocaleCode(TranslationsMeta.java:80)
    at io.github.stekeblad.videouploader.windowControllers.SettingsWindowController.onWindowClose(SettingsWindowController.java:83)
    at io.github.stekeblad.videouploader.jfxExtension.MyStage.lambda$triggerController$0(MyStage.java:62)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.graphics/com.sun.javafx.stage.WindowPeerListener.closing(WindowPeerListener.java:93)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.run(GlassWindowEventHandler.java:147)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.run(GlassWindowEventHandler.java:40)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.lambda$handleWindowEvent$4(GlassWindowEventHandler.java:176)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:390)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassWindowEventHandler.handleWindowEvent(GlassWindowEventHandler.java:174)
    at javafx.graphics/com.sun.glass.ui.Window.handleWindowEvent(Window.java:1346)
    at javafx.graphics/com.sun.glass.ui.Window.notifyClose(Window.java:1246)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:834)

The following is my system information:

Operating system: Windows JDK: AdoptOpenJDK 11 Hotspot Locale: Japanese

The workaround to this bug is simply assign a value to the empty dropdown. Not a serious bug; it just annoys me.

Stekeblad commented 4 years ago

Hi ye-yu. You are right about that an invalid language choice should be detected and changed to default instead of throwing up an error message. I am surprised that you do not report a bigger problems when using Java 11, I have only tested the program with Java 8.

The message "Could not find a matching or partially matching translation..." can probably be removed, but I wonder why Java report your locale as en_US when you write its set to Japanese.