Last active
September 17, 2015 08:14
-
-
Save dommmel/cf0ceb4c425b39f628db to your computer and use it in GitHub Desktop.
i18n for static-handlebars-brunch via handlebars-helper-i18n
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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