tests: Make tests independent of locale settings.
tests: Support mapping types of translation for patching.