Using a tool such as l10n.js http://eligrey.com/blog/post/passive-localization-in-javascript https://github.com/eligrey/l10n.js/#readme