@shore/i18n-hbs-helper
v1.1.0
Published
A module exporting an object as the default providing a method to register some i18n Handlebars helpers
Downloads
11
Readme
i18n-hbs-helper
A module exporting an object as the default providing a method to register some i18n Handlebars helpers.
Usage
import Handlebars form 'handlebars';
import I18n from '@shore/i18n';
import I18nHbsHelper from '@shore/i18n-hbs-helper';
I18nHbsHelper.register(Handlebars, I18n);
Then just use the t
ranslate helper in your Handlebars template:
{{t "foo.bar.baz" }}
{{t "foo" "bar" "baz" }}
{{t "foo.bar" "baz" }}
{{t "foo" "bar" varReturningBaz }}
{{t "foo.bar.baz" var1="foo" var2="bar" }}