zDevelopers / UHPlugin

Plugin UltraHardcore (“Kill the Patrick”), augmenté. | UHC (“KTP”) plugin, improved.
Other
32 stars 24 forks source link

change lang in config.yml causes exceptions #134

Open chiu01 opened 8 years ago

chiu01 commented 8 years ago

Environment

change lang to zh_CN, or en_US or fr_FR cause exception list below:

[03:05:00 ERROR]: [Craft Scheduler Thread - 0] Invalid plural script for language : “n !”
[03:05:00 ERROR]: [Craft Scheduler Thread - 0] Exception : 
javax.script.ScriptException: <eval>:1:2 Expected ; but found !
n !
  ^ in <eval> at line number 1 at column number 2
        at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:467) ~[n
ashorn.jar:?]
        at jdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(NashornScriptEngine.java:534) ~[nashorn.jar:
?]
        at jdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(NashornScriptEngine.java:521) ~[nashorn.jar:
?]
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:399) ~[nashorn.jar:?]
        at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155) ~[nashorn.jar:?]
        at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264) ~[?:1.8.0_91]
        at eu.carrade.amaury.UHCReloaded.zlib.components.i18n.translators.gettext.GettextPOTranslator.getPluralIn
dex(GettextPOTranslator.java:100) [UHCReloaded-1.3-SNAPSHOT.jar:?]
        at eu.carrade.amaury.UHCReloaded.zlib.components.i18n.translators.Translator.translate(Translator.java:96
) [UHCReloaded-1.3-SNAPSHOT.jar:?]
        at eu.carrade.amaury.UHCReloaded.zlib.components.i18n.I18n.translate(I18n.java:561) [UHCReloaded-1.3-SNAP
SHOT.jar:?]
        at eu.carrade.amaury.UHCReloaded.zlib.components.i18n.I.tn(I.java:109) [UHCReloaded-1.3-SNAPSHOT.jar:?]
        at eu.carrade.amaury.UHCReloaded.scoreboard.GameSidebar.preRender(GameSidebar.java:149) [UHCReloaded-1.3-
SNAPSHOT.jar:?]
        at eu.carrade.amaury.UHCReloaded.zlib.components.scoreboard.Sidebar.refresh(Sidebar.java:277) [UHCReloade
d-1.3-SNAPSHOT.jar:?]
        at eu.carrade.amaury.UHCReloaded.zlib.components.scoreboard.Sidebar$1.run(Sidebar.java:342) [UHCReloaded-
1.3-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_9_R2.scheduler.CraftTask.run(CraftTask.java:58) [patched_1.9.4.jar:git-Paper
-750]
        at org.bukkit.craftbukkit.v1_9_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53) [patched_1.9.4.jar
:git-Paper-750]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) [
patched_1.9.4.jar:git-Paper-750]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_91]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_91]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91]
Caused by: jdk.nashorn.internal.runtime.ParserException: <eval>:1:2 Expected ; but found !
n !
  ^
        at jdk.nashorn.internal.parser.AbstractParser.error(AbstractParser.java:292) ~[nashorn.jar:?]
        at jdk.nashorn.internal.parser.AbstractParser.error(AbstractParser.java:277) ~[nashorn.jar:?]
        at jdk.nashorn.internal.parser.AbstractParser.expectDontAdvance(AbstractParser.java:348) ~[nashorn.jar:?]
        at jdk.nashorn.internal.parser.AbstractParser.expect(AbstractParser.java:335) ~[nashorn.jar:?]
        at jdk.nashorn.internal.parser.Parser.endOfLine(Parser.java:3372) ~[nashorn.jar:?]
        at jdk.nashorn.internal.parser.Parser.expressionStatement(Parser.java:1160) ~[nashorn.jar:?]
        at jdk.nashorn.internal.parser.Parser.statement(Parser.java:967) ~[nashorn.jar:?]
        at jdk.nashorn.internal.parser.Parser.sourceElements(Parser.java:773) ~[nashorn.jar:?]
        at jdk.nashorn.internal.parser.Parser.program(Parser.java:709) ~[nashorn.jar:?]
        at jdk.nashorn.internal.parser.Parser.parse(Parser.java:283) ~[nashorn.jar:?]
        at jdk.nashorn.internal.parser.Parser.parse(Parser.java:249) ~[nashorn.jar:?]
        at jdk.nashorn.internal.runtime.Context.compile(Context.java:1286) ~[nashorn.jar:?]
        at jdk.nashorn.internal.runtime.Context.compileScript(Context.java:1253) ~[nashorn.jar:?]        
        at jdk.nashorn.internal.runtime.Context.compileScript(Context.java:625) ~[nashorn.jar:?]
        at jdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(NashornScriptEngine.java:532) ~[nashorn.jar:
?]
        ... 17 more

Steps to reproduce

stop server start server exception occurs

AmauryCarrade commented 8 years ago

zLib related.

I already seen this problem once, but only once and I was not able to explain exactly how it occurs. Can I know your Java version, distribution (OpenJDK or Oracle); also, did you experienced encoding issues?

Thanks.

chiu01 commented 8 years ago

My environment:

pastebin log [http://pastebin.com/ySnBhfpi]

AmauryCarrade commented 8 years ago

Thanks; I'll try to understand then fix the problem.