The issue was happening because some translations required the value of both a per-level stat and a static stat. The get_translation method was not able to accept stat values that did not match the input stats, so l changed it to be able to accept a dictionary of values (as well as a list of values matching the input stats, to maintain backward compatibiliy).
This allowed correct stat translations to be produced, but translations produced for static stats that depended on level data were still broken, so some code was added to track which static stats were used in dynamic translations in order to prevent broken translations from being added to the stat text.
Abstract
Fixes several reported stat text issues
Action Taken
The issue was happening because some translations required the value of both a per-level stat and a static stat. The get_translation method was not able to accept stat values that did not match the input stats, so l changed it to be able to accept a dictionary of values (as well as a list of values matching the input stats, to maintain backward compatibiliy).
This allowed correct stat translations to be produced, but translations produced for static stats that depended on level data were still broken, so some code was added to track which static stats were used in dynamic translations in order to prevent broken translations from being added to the stat text.
Results of applying this fix can be viewed at https://github.com/lvlvllvlvllvlvl/wiki-data-export/commit/89a7e84c4cfb8b739248f27180bddcb8a8c5e007
Caveats
l am not aware of any caveats. The code is quite confusing though, so there could well be problems that l am unaware of.