Fix unit tests for non-english locales

I finally found a centralized fix for all the issues with Strings in unit tests.
For #8672.