Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am henr-y on github.
  • I am explodingcamera (https://keybase.io/explodingcamera) on keybase.
  • I have a public key whose fingerprint is 33F9 5B72 5FCA DE47 9EB3 7DED DDE6 E318 1ABC FA86

To claim this, I am signing this object:

@explodingcamera
explodingcamera / handlebars.localisation.js
Created January 14, 2016 20:12 — forked from tracend/handlebars.localisation.js
Handlebars Localisation Helper #cc
// Handlebars Localisation Helper
// Source: https://gist.github.com/tracend/3261055
Handlebars.registerHelper('l10n', function(keyword) {
var lang = (navigator.language) ? navigator.language : navigator.userLanguage;
// pick the right dictionary (if only one available assume it's the right one...)
var locale = window.locale[lang] || window.locale['en-US'] || window.locale || false;
// exit now if there's no data
if( !locale ) return target;