Skip to content

fix(helpers): include unit name keys with variant suffixes like _NAME_V2 - #133

Merged
MarTrepodi merged 1 commit into
developfrom
fix/unit-name-variant-suffixes
Sep 1, 2026
Merged

fix(helpers): include unit name keys with variant suffixes like _NAME_V2#133
MarTrepodi merged 1 commit into
developfrom
fix/unit-name-variant-suffixes

Conversation

@MarTrepodi

Copy link
Copy Markdown
Collaborator

Summary

Fixes #132.

create_localized_unit_name_dictionary() filtered localization entries with name_key.endswith("_NAME"), which silently dropped unit name keys carrying a variant suffix such as UNIT_JEDIKNIGHTREVAN_NAME_V2. Those units were missing from the BASEID → display-name mapping.

Changes

  • Match any UNIT_* key containing _NAME (covers _NAME, _NAME_V2, and any future _NAME.* variant) while still excluding _DESC and other non-name entries.
  • Split lines with split("|", 1) so a description containing a | character cannot break tuple unpacking.
  • Added regression test test_name_variant_suffixes_included covering the _NAME_V2 case.

Testing

  • uv run pytest tests/unit/test_helpers.py — 211 passed.
  • Pre-commit hooks (ruff, ruff format, ty check, commitlint) passed on commit.

🤖 Generated with Claude Code

create_localized_unit_name_dictionary() previously matched keys with
endswith("_NAME"), silently dropping entries such as
UNIT_JEDIKNIGHTREVAN_NAME_V2. Match any UNIT_* key containing _NAME
instead, and split lines with maxsplit=1 so a description containing a
pipe character cannot break unpacking.

Fixes #132

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@MarTrepodi MarTrepodi self-assigned this Sep 1, 2026
@MarTrepodi
MarTrepodi merged commit deaa932 into develop Sep 1, 2026
15 checks passed
@MarTrepodi
MarTrepodi deleted the fix/unit-name-variant-suffixes branch September 1, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant