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

  On 15/11/2018 at 7:46 AM, (-_-) said:

Could very well be a mistranslation

Expand  

That ^, because in

  On 15/11/2018 at 4:02 AM, gameboy said:

tooltips.js:399

Expand  

there is

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

and

  On 15/11/2018 at 4:02 AM, gameboy said:

[sprintf] property 'hotkey' does not exist

Expand  

using

  Quote

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

Expand  

gives one result:

  Quote

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

Expand  

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: 切换至历史"

Expand  

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: 切换至历史"

Expand  

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

  On 15/11/2018 at 8:58 AM, 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)? 

Expand  

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.” “”

Expand  

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...