Jump to content

sprintf property 'hotkey' does not exist


gameboy
 Share

Recommended Posts

Today, I tested the latest SVN21931. When I was playing a single player game in the game, this error message came up:

ERROR: JavaScript error: globalscripts/sprintf.js line 66 Error: [sprintf] property 'hotkey' does not exist sprintf.format@globalscripts/sprintf.js:66:1 sprintf@globalscripts/sprintf.js:50:16 getRepairTimeTooltip@gui/common/tooltips.js:399:3 displaySingle@gui/session/selection_details.js:257:34 updateSelectionDetails@gui/session/selection_details.js:463:3 updateGUIObjects@gui/session/session.js:945:2 onSimulationUpdate@gui/session/session.js:875:2 __eventhandler105 (simulationupdate)@session simulationupdate:0:1

ERROR: JavaScript error: globalscripts/sprintf.js line 66 Error: [sprintf] property 'hotkey' does not exist sprintf.format@globalscripts/sprintf.js:66:1 sprintf@globalscripts/sprintf.js:50:16 getRepairTimeTooltip@gui/common/tooltips.js:399:3 displaySingle@gui/session/selection_details.js:257:34 updateSelectionDetails@gui/session/selection_details.js:463:3 updateGUIObjects@gui/session/session.js:945:2 onSimulationUpdate@gui/session/session.js:875:2 __eventhandler105 (simulationupdate)@session simulationupdate:0:1

ERROR: JavaScript error: globalscripts/sprintf.js line 66 Error: [sprintf] property 'hotkey' does not exist sprintf.format@globalscripts/sprintf.js:66:1 sprintf@globalscripts/sprintf.js:50:16 getRepairTimeTooltip@gui/common/tooltips.js:399:3 displaySingle@gui/session/selection_details.js:257:34 updateSelectionDetails@gui/session/selection_details.js:463:3 updateGUIObjects@gui/session/session.js:945:2 onSimulationUpdate@gui/session/session.js:875:2 __eventhandler105 (simulationupdate)@session simulationupdate:0:1

ERROR: JavaScript error: globalscripts/sprintf.js line 66 Error: [sprintf] property 'hotkey' does not exist sprintf.format@globalscripts/sprintf.js:66:1 sprintf@globalscripts/sprintf.js:50:16 getRepairTimeTooltip@gui/common/tooltips.js:399:3 displaySingle@gui/session/selection_details.js:257:34 updateSelectionDetails@gui/session/selection_details.js:463:3 updateGUIObjects@gui/session/session.js:945:2 onSimulationUpdate@gui/session/session.js:875:2 __eventhandler105 (simulationupdate)@session simulationupdate:0:1

Link to comment
Share on other sites

Which language did you use (ingame)? Could very well be a mistranslation. And as far as I can tell, its not english right (judging from the bot names)?

Edited by Guest
Link to comment
Share on other sites

1 hour ago, (-_-) said:

Could very well be a mistranslation

That ^, because in

4 hours ago, gameboy said:

tooltips.js:399

there is

"Add another worker to speed up the repairs by %(second)s second."

and

4 hours ago, gameboy said:

[sprintf] property 'hotkey' does not exist

using

Quote

grep -R '"Add another worker to speed up the repairs by %(second)s second."' -A5 | grep hotkey

gives one result:

Quote

zh.public-gui-other.po-msgstr[0] "%(hotkey)s: 切换至历史"

Entirely:

Quote

#: gui/common/tooltips.js:402
#, javascript-format
msgid "Add another worker to speed up the repairs by %(second)s second."
msgid_plural ""
"Add another worker to speed up the repairs by %(second)s seconds."
msgstr[0] "%(hotkey)s: 切换至历史"

So someone added a broken translation that should be fixed as soon as possible on transifex.

Gratis bonus fact, the translation was copied from:

Quote

#: gui/reference/structree/structree.js:49
#, javascript-format
msgid "%(hotkey)s: Switch to History."
msgstr "%(hotkey)s: 切换至历史"

Now who wants to write the script that checks all *.po files for this mistake systematically, so that players don't have to randomly discover it (or even the trac ticket)?

Link to comment
Share on other sites

@elexis  Thank you, my friend, I have given the solution. I have fixed the problem.

#: gui/common/tooltips.js:402
#, javascript-format
msgid "Add another worker to speed up the repairs by %(second)s second."
msgid_plural ""
"Add another worker to speed up the repairs by %(second)s seconds."
msgstr[0] "增加一另个工人,在 %(second)s 秒后修复。"

Link to comment
Share on other sites

14 hours ago, elexis said:

Now who wants to write the script that checks all *.po files for this mistake systematically, so that players don't have to randomly discover it (or even the trac ticket)? 

That's me. A nice one day task with regards to the first implementation: D1674.

Using this script I found there are three further strings that throw errors upon use that noone found yet:

Quote

sk.public-gui-other.po: The sprintf argument %(trained)s used by the translation “Štatistika jednotiek (%(trained)s / %(killed)s / %(captured)s / %(lost)s)” isn't a present in the template string “Siege” “”
zh_TW.public-gui-other.po: The sprintf argument %(endWarning)s used by the translation “ %(endWarning)s 您似乎正使用非著色器(shader 一種特定功能)的顯示晶片。這個選項將會在未來的 0 A.D. 版本中移除以便啟用更多的進階圖形特色。我們建議您盡速升級您的顯示卡到較新、相容著色器語言的。” isn't a present in the template string “%(warning)s You appear to be using non-shader (fixed function) graphics. This option will be removed in a future 0 A.D. release, to allow for more advanced graphics features. We advise upgrading your graphics card to a more recent, shader-compatible model.” “”
ar.public-gui-other.po: The sprintf argument %(civ)s used by the translation “%(civ)s :الانتقال لشجرة البنية” isn't a present in the template string “%(hotkey)s: Switch to Structure Tree.” “”

The nice thing is we know that we can find all of them by running a short script, i.e. there are certainly not more than these three. Now who wants to update transifex?

  • Haha 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...