Skip to content

Instantly share code, notes, and snippets.

@dommmel
Last active September 17, 2015 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dommmel/cf0ceb4c425b39f628db to your computer and use it in GitHub Desktop.
Save dommmel/cf0ceb4c425b39f628db to your computer and use it in GitHub Desktop.
i18n for static-handlebars-brunch via handlebars-helper-i18n
/*
put this file in your app folder and add the following to yout brunch config.coffee
exports.config =
plugins:
staticHandlebars:
includeFile: 'app/translations.js'
# Usage examples:
# {{i18n "key"}}
# {{i18n "key" language="fr"}}
# {{ > partialname language="fr" }} ans in the partial {{ i18n "key" }}
*/
module.exports = function(handlebars) {
try {
i18nHelper = require('handlebars-helper-i18n');
handlebars.registerHelper('i18n', i18nHelper.i18n);
} catch (undefined) {}
return {
language: 'en',
en: { "value" },
fr: { "valeur" }
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment