Fix handling of locales for l10n tests (#534)