I’m using ember-i18n in my application and my models have properties like nameEn and nameFr.
To provide a generic way to access the name in the current locale, I created a helper to handles this
{{i18n-get myRecord "name" locale}}
if locale is fr it will go fetch nameFr for instance.
It works quite well when myRecord is the route’s model and is loaded but when it’s a promise, it will not recompute when the record is finally loaded.
Is there any way to create a helper that recomputes when one of its arguments is a Model/Promise? I have a hard time finding a solution about this when searching Google.
Thanks for this example. I’m not sure how to use this though. Here you’re using a timer to call the notifyPropertyChange but in our case it’s when the promise gets resolved. I think tracking each and every relationship of the model and trigger this would make for a big mess in the code
Since then we ended up using a helper to get the localized attribute name and a classic {{get to obtain it. Not the solution I was hoping for but at least it works and we got to deliver something ^^