#6433 closed defect (fixed)
[26393] l10n.js Script value conversion check failed: v.isString() || v.isNumber() || v.isBoolean()
Reported by: | Langbart | Owned by: | bb |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 26 |
Component: | UI – Game setup | Keywords: | |
Cc: | Patch: | phab:D4492 |
Description (last modified by )
to reproduce
- Start a game with the
autostart
command e.g.
binaries/system/pyrogenesis -conf=mod.enabledmods:"mod public" -autostart="random/unknown" -autostart-seed=-1 -autostart-civ=1:spart -autostart-civ=2:brit -autostart-ai=2:petra
- Errors appear
0 A.D. (0.0.26) Main log (warnings and errors only) ERROR: JavaScript error: gui/common/l10n.js line 69 Script value conversion check failed: v.isString() || v.isNumber() || v.isBoolean() (got type undefined) translate@gui/common/l10n.js:69:36 TitleDisplay@gui/loading/TitleDisplay.js:11:13 init@gui/loading/loading.js:10:19 ERROR: GUI page 'page_loading.xml': Failed to call init() function ERROR: JavaScript error: gui/loading/loading.js line 22 g_LoadingPage is undefined reallyStartGame@gui/loading/loading.js:22:2
bisect
The issue can be noticed for the first time with changeset [26393]
File causing issues
Line 11 in the file gui/loading/TitleDisplay.js
has been changed. If I undo the change, the problem for the autostart
command is no longer reproducible, but the normal GUI game setup within the app is broken.
-
ps/trunk/binaries/data/mods/public/gui/loading/TitleDisplay.js
1 1 /** 2 2 * This class choses the title of the loading screen page. 3 3 */ 4 4 class TitleDisplay 5 5 { 6 6 constructor(data) 7 7 { 8 8 let loadingMapName = Engine.GetGUIObjectByName("loadingMapName"); 9 9 loadingMapName.caption = sprintf( 10 10 data.attribs.mapType == "random" ? this.Generating : this.Loading, 11 { "map": translate(data.attribs.settings. Name) });11 { "map": translate(data.attribs.settings.mapName) }); 12 12 } 13 13 } 14 14 15 15 TitleDisplay.prototype.Generating = translate("Generating “%(map)s”"); 16 16 17 17 TitleDisplay.prototype.Loading = translate("Loading “%(map)s”");
possible Solution:
The addition of || data.attribs.settings.Name
solves the problem, but is this the right solution?
Attachments (1)
Change History (7)
by , 2 years ago
Attachment: | change_26393.jpg added |
---|
comment:1 by , 2 years ago
Description: | modified (diff) |
---|
comment:3 by , 2 years ago
Aight autostart. Forgot about those. The issue is that the Autostart engine (Gamesetup.cpp) assumes that the settings as in the map json need to be transferred directly to the settings.
We should pipe the GameSetup.cpp autostart through the GameSettings (use the autostart gui page).
Notice the same issue going on with the map Preview (though it doesn't crash since the preview is not used anywhere outside gamesetup).
comment:4 by , 2 years ago
Patch: | → phab:D4492 |
---|
comment:6 by , 2 years ago
Summary: | [26393] Errors pop up → [26393] l10n.js Script value conversion check failed: v.isString() || v.isNumber() || v.isBoolean() |
---|
better title
additional comment on the file causing the problem