ldo/ShaderTools — comment on commit df2de33b2e44ce02f3ce1e8944f9961b79758878
File:  line 0
By ldo:

This is the first example of how I use table-drive/data-driven programming in this project. Instead of a whole lot of if-then comparisons against the message keys, I set up a dictionary of lists. This takes advantage of your convention for constructing the key strings out of a section-name prefix followed by a key within that section, to check that the key read for each line is one of the valid ones.

Actually this check is probably unnecessary; you could simply read every key that is provided by the lang file. However, it could be useful to turn it the other way: check that a lang file defines every required message, otherwise throw an error immediately on loading, instead of waiting until you crash at some random point later because a message cannot be displayed.