fix(l10n): normalize locale name when generating json strings

Fixes #759.

@pdehaan r?