Fix Gallery tests
Refactor l10n.js