I am working on an application that is currently localized in six languages. Localization engineers occasionally test to make sure that all of their strings are contextually appropriate and appear correctly in the application.
Something that's taking ever more time is their testing of error messages that are unlikely to be encountered with regular usage, or by following specific instructions. Originally, a developer would create the error conditions, cause the error to appear in each language, take screenshots, and send those to localization to inspect for correctness.
Someone noticed that this was taking a long time, and so built a helper-application in a development branch. This helper-application, when launched, shows a window beside the main application window with a list of error messages that can be shown. When the tester clicks on an entry in that list, reflection is used to burrow into the program logic and mess with private fields and such to create the error condition and cause the error message to appear. This does save time, but not all that much, because it's hard to maintain and extend.
I would like to find a better solution. Currently I'm considering refactoring the generation of all such error messages into a static class, and adding the "show error messages" window mentioned above to the application trunk, to appear only if a certain preprocessor symbol is defined. Then, error messages can be generated either in response to actual error conditions, or just in response to the click of a button in the "show error messages" window, with the same code generating the error message in both cases. The one significant thing that worries me is that we wouldn't be able to be totally sure that the same error message appears in both the real and fake error scenarios, though this is certainly also true of the reflection solution.
How have others dealt with similar situations?
This is a C# application with a WPF user interface.