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
Sorry for the slow response. I wasn't aware of this macro in ember-i18n, and I like the idea a lot. However, I'm not crazy about the syntax used in ember-i18n, because it doesn't match most computed property macros. Using the example from the documentation above, I would prefer something that looked like this:
import{translationMacroast}from"ember-i18next";exportdefaultEmber.Component.extend({// A simple translation.title: t('user.edit.title'),followersCount: 1,count: Ember.computed.alias('followersCount'),// A translation with interpolations. This computed property// depends on `count` and will send `{ count: this.get('count') }`// in to the translation.followersTitle: t('user.followers.title','count')});
The main difference being that the arguments to the macro are dependent property names rather than an options hash.
I'd be happy to accept a PR that matches the example above. No worries if you don't currently have the time; I can quickly implement it myself before the next release.
I think the macro idea from
ember-i18n
is really neat: https://github.com/jamesarosen/ember-i18n/wiki/Doc:-Translating-Text#translation-computed-property-macroIt would be nice to have that here too. For now I ported the code to my project but if it is something you want maybe I can work on a PR.
The text was updated successfully, but these errors were encountered: