In src/EU4/Common.hs, the function triggerEvent tries to find the localized name of the event being triggered by guessing its localization key. This is only necessary because we currently do localization up front, while parsing. If we instead delay localization until needed (i.e. when pretty-printing), it can be looked up from the event itself instead.
This implies parsing all data files before producing any output. It would also eliminate the current special case of parsing idea groups before anything else, and remove the dependency of src/EU4/Common.hs on src/EU4/IdeaGroups.hs.
In
src/EU4/Common.hs
, the functiontriggerEvent
tries to find the localized name of the event being triggered by guessing its localization key. This is only necessary because we currently do localization up front, while parsing. If we instead delay localization until needed (i.e. when pretty-printing), it can be looked up from the event itself instead.This implies parsing all data files before producing any output. It would also eliminate the current special case of parsing idea groups before anything else, and remove the dependency of
src/EU4/Common.hs
onsrc/EU4/IdeaGroups.hs
.