Closed kdbanman closed 10 years ago
I have been avoiding to deal with this mainly because we are still using Jassa and haven't gotten into how we're going to replace the basic functionality we use from it. There is also the question of we want to get into using Ember-Data which is nearing a stable release.
Localization state can be managed using a global or route based binding such as property in the endpoint route.
Not really sure what you mean by Ember.Model. A route's model hook is what holds current route's data and can be backed by a single or an array controller. I'll try adding an Ember friendly POJO to represent resources.
I have added a very basic model for resources that supports labels and comments. It has a binded value to the store
singleton.
Only thing left is to add a some UI element that sets the language value on store
and then every resource will change labels/comment automatically.
Having code like this in more than one place is too implementation-dependent:
I would rather see something like this across components.
I'm not sure how best to make that work with language localization options in the future. This depends upon how we implement localization state, but it needs be possible to make the label getter aware of the currently preferred language.
Using an
Ember.Model
doesn't make sense for this, because aModel
has a one-to-one relationship with controllers, routes, etc. (right?) There are reasonable options in es6 for defining our own objects/classes with dynamically computed properties.