Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract nested monster attack messages for translation #70772

Merged

Conversation

BrettDong
Copy link
Member

Summary

None

Purpose of change

Attack messages in monster_attack embedded in the special_attacks array of MONSTER definitions are not extracted for translation.

A stripped-down example:

  {
    "id": "mon_star_vampire",
    "type": "MONSTER",
    "name": { "str": "star vampire" },
    "special_attacks": [
      {
        "type": "monster_attack",
        "attack_type": "bite",
        "id": "star_vampire_bite",
        "hit_dmg_u": "%1$s bites your %2$s with its fang-filled maw!",
        "hit_dmg_npc": "%1$s bites <npcname>'s %2$s with its fang-filled maw!",
        "miss_msg_u": "%1$s tries to bite you, but you dodge!",
        "miss_msg_npc": "%1$s tries to bite <npcname>, but they dodge!",
        "no_dmg_msg_u": "%1$s tries to bite your %2$s, but can't penetrate your armor.",
        "no_dmg_msg_npc": "%1$s tries to bite <npcname>'s %2$s, but can't penetrate their armor."
      }
  ]
}

Describe the solution

Check for monster_attack objects in special_attacks in MONSTER.

Describe alternatives you've considered

Testing

These attack messages now appear in the generated translation template after this patch.

#. ~ Monster attack "star_vampire_bite" message
#: data/json/monsters/nether.json
#, c-format
msgid "%1$s bites your %2$s with its fang-filled maw!"
msgstr ""

#. ~ Monster attack "star_vampire_bite" message
#: data/json/monsters/nether.json
#, c-format
msgid "%1$s bites <npcname>'s %2$s with its fang-filled maw!"
msgstr ""

Additional context

@github-actions github-actions bot added Translation I18n Monsters Monsters both friendly and unfriendly. [Python] Code made in Python labels Jan 8, 2024
@BrettDong BrettDong added the 0.H Backport PR to backport to the 0.H stable release canddiate label Jan 8, 2024
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Jan 8, 2024
Copy link
Contributor

github-actions bot commented Jan 8, 2024

Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.

Click to expand
  • %1$s starss at , but the telekinetic attack rebounds off their armor.
  • %s lunges foward to bite , but they dodge!

This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt so they will not trigger an alert next time.

@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Jan 8, 2024
@ZhilkinSerg ZhilkinSerg merged commit 3bbb9ce into CleverRaven:master Jan 8, 2024
18 of 22 checks passed
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jan 8, 2024
@BrettDong BrettDong deleted the translate-nested-mon-attack branch January 8, 2024 13:34
Procyonae pushed a commit to Procyonae/Cataclysm-DDA that referenced this pull request May 14, 2024
kevingranade added a commit that referenced this pull request May 14, 2024
@Procyonae Procyonae added 0.H Backported and removed 0.H Backport PR to backport to the 0.H stable release canddiate labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.H Backported astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions json-styled JSON lint passed, label assigned by github actions Monsters Monsters both friendly and unfriendly. [Python] Code made in Python Translation I18n
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants