raethkcj / RatingBuster

An item comparison tool for WoW Classic.
GNU General Public License v2.0
58 stars 14 forks source link

Autogenerate StatLogic locales #175

Closed raethkcj closed 8 months ago

raethkcj commented 9 months ago

Motivation

StatLogic's locales (note: not RatingBuster's locales) are a major pain point in keeping stat summaries accurate, even in English. They're not a typical locale file because they're not just enUS -> xxYY translations, they're a reverse mapping of strings Blizzard uses to stats defined in the addon. For this reason, it's very difficult for localizers to know what to translate. They can't just translate the English strings, they have to know (or guess) which items have the relevant stat string, as well as which garbled form will actually be passed to StatIDLookup after it's been broken down by DeepScan. /sldebug helps with this some, but it still requires localizers to have technical knowledge of both the game, and the internals of StatLogic. That's not a sustainable expectation.

Goal

I'd like to remove most of StatLogic's "scanners" (SinglePlus, SingleEquip, PreScan (non-exclude part), DeepScan and all its children), and leave only WholeText and Substitution. PrefixExclude, ColorExclude, and the exclude part of PreScan might be removed eventually, but at the very least they are helpful for debugging Substitution while it's still a work-in-progress.

Removing these scanners would allow all of their associated tables in the locale files to be deleted as well: PrefixExclude, PreScanPatterns, DeepScanSeparators, DeepScanWordSeparators, DualStatPatterns, and DeepScanPatterns, as well as the miscellaneous translations of tonumber, SinglePlusStatCheck, SingleEquipStatCheck, etc.

Then, I'd like to use a combination of GlobalStrings, and lists of strings generated directly from CSV dumps of DB2s to populate the remaining tables, WholeTextLookup and StatIDLookup. There would be no exclusions; anything not matching WholeText or Substitution could immediately be discarded. The handful of exclusions remaining in GlobalPatterns could also be removed. There would be no more need for hand-translating these files, and new stats could instead be added as inputs to the (yet unwritten) locale-independent script that generates the strings for all locales.

Implementation

raethkcj commented 9 months ago

All pre-existing enUS stats have been identified by their Enchant or Spell ID and expansion!

Some minor notes: