Fix handling of locales for l10n tests (#534)

Can someone please have a look so we can get it landed soon? Thanks.