Skip to content

Instantly share code, notes, and snippets.

@dommmel
Last active Sep 17, 2015
Embed
What would you like to do?
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