fix(helpers): include unit name keys with variant suffixes like _NAME_V2 - #133
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #132.
create_localized_unit_name_dictionary()filtered localization entries withname_key.endswith("_NAME"), which silently dropped unit name keys carrying a variant suffix such asUNIT_JEDIKNIGHTREVAN_NAME_V2. Those units were missing from the BASEID → display-name mapping.Changes
UNIT_*key containing_NAME(covers_NAME,_NAME_V2, and any future_NAME.*variant) while still excluding_DESCand other non-name entries.split("|", 1)so a description containing a|character cannot break tuple unpacking.test_name_variant_suffixes_includedcovering the_NAME_V2case.Testing
uv run pytest tests/unit/test_helpers.py— 211 passed.🤖 Generated with Claude Code