You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The translation macro (and soon decorator #623) currently only allow the user to pass keys that will then be used to retrieve the values to be used for interpolating the translation strings: Docs
importComponentfrom'@ember/component':
import{translationMacroast}from'ember-intl';exportdefaultComponent.extend({followersCount: 1,// A translation with interpolations. This computed property// depends on `count` and will send `{ count: this.followersCount }`// in to the translation.followersTitle: t('user.followers.title',{count: 'followersCount'})});
Assume the count variable is static. We can't pass { count: 1 }, instead we need to go through one unnecessary step of redirection by setting followersCount: 1 and then passing { count: 'followersCount' }.
importComponentfrom'@ember/component':
import{translationMacroast,raw}from'ember-intl';exportdefaultComponent.extend({// A translation with static interpolations. This computed property// has no dependencies (other than the implicit `intl.locale`)// and will send `{ count: 1 }`followersTitle: t('user.followers.title',{count: raw(1)})});
The text was updated successfully, but these errors were encountered:
As suggested in #624 (comment).
The translation macro (and soon decorator #623) currently only allow the user to pass keys that will then be used to retrieve the values to be used for interpolating the translation strings: Docs
Assume the
count
variable is static. We can't pass{ count: 1 }
, instead we need to go through one unnecessary step of redirection by settingfollowersCount: 1
and then passing{ count: 'followersCount' }
.We propose adding a
raw
function like inember-awesome-macros
/ember-macro-helpers
:The text was updated successfully, but these errors were encountered: