Repository navigation
[Tools] Preserve ATT conditions when normalizing locale tables. - #2820
Merged
Merged
Conversation
* Handle nested and consecutive conditionals and preserve versioned values. * Check missing and duplicate locale slots on the paths where they occur. * Add CLI regressions for Dragonriding Cup and Blackrock Spire. Assisted-by: gpt-6.2-astra.
NORPG
force-pushed
the
codex/normalize-lua-conditions
branch
from
December 4, 2026 16:14
2b211b4 to
3ae175e
Compare
NORPG
marked this pull request as ready for review
December 4, 2026 16:19
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
The Lua localization normalizer could discard ATT directives while reordering a table. In Dragonriding Cup this could remove an era's name. In Blackrock Spire it could separate a locale assignment from the version-specific text that supplies its value.
Feature Introduction
Run
node .contrib/.tools/Lua/normalize.js "path/to/data-file.lua"or use the Normalize Lua Table task in Visual Studio Code.The formatter now follows nested and consecutive conditional blocks in
text,description, andlore. It keeps values with their directives, preserves shared fields, and adds missing locale TODOs in the established order on multilingual paths. English-only paths stay compact.When two slots for the same locale could appear together, the tool reports both source locations and identifies active and commented entries. It preserves the original table for review. If filling a gap would require introducing another branch, it reports the missing locale. Comparisons at different thresholds are treated as potentially overlapping.
Tests
node --test .contrib/.tools/Lua/tests/normalize.test.cjsfrom the repository root. All 17 cases passed locally. The new GitHub Actions workflow runs the suite when the formatter, its tests, or the two real data fixtures change.AI Assistance
AI assistance was used with
gpt-6.2-astrato implement the normalizer, write and run the regression tests, verify the Dragonriding Cup and Blackrock Spire data, and draft this pull request.