Search code examples
ember.jsinternationalizationember-i18n

Handlebars helper i18n


If I'm using an Ember.js built in helper input

{{input value=query class="form-input" placeholder="Search"}}

I want to replace the placeholder string "Search" with a translated version of that string.

Normally, if I wasn't already using the input helper, I would access the translated string like this:

{{ t "home.search" }}

Solution

  • Figured this out by using Subexpressions: http://handlebarsjs.com/expressions.html

    {{input value=query class="form-input" placeholder=(t "home.search") }}