ember-cli-i18n icon indicating copy to clipboard operation
ember-cli-i18n copied to clipboard

Fix helper error on Ember 1.13.0

Open bhserna opened this issue 9 years ago • 7 comments

I am not sure how are you dealing with handling different ember versions, but I am using this addon and after update to Ember 1.13.0 I got this error:

screenshot 2015-06-15 14 22 08

I played a little in the console and I found that view is now inside env. So I did this little change to make it work in my project.

Now it can work with the two versions, the problem is that I don't know how to test this because (as far as I understand) this function is just tested with acceptance tests and I am not sure how to handle another ember version. I think that a test is necessary because the reason of the change is not clear for someone that is just watching the helper code.

Well... hope it helps =)

bhserna avatar Jun 15 '15 19:06 bhserna

:+1: I can confirm this is working under Ember 1.13.2. Just upgraded and with 0.0.6, app broke. Replaced myself the files to test.

Hope this gets merged asap, will have to branch for the time being.

mauricioac avatar Jun 22 '15 14:06 mauricioac

:+1: Came to the same solution yesterday when I upgraded my project to 1.13.

iamolivinius avatar Jun 23 '15 09:06 iamolivinius

We should actually swap to extend from Ember.Helper for 1.13+. This lets us remove some of the hacks we have:

  • gives us access to the container
  • allows us to call recompute (which is conceptually similar to rerender of a view) when the locale changes

rwjblue avatar Jun 23 '15 14:06 rwjblue

Although, I think that it might be better to just officially deprecate the library in favor of ember-i18n and focus our efforts over there...

rwjblue avatar Jun 23 '15 14:06 rwjblue

@rwjblue I didn't know about the new Ember.Helper api ... and also didn't know about ember-i18n =S, but looks very nice and I think that migrate a project to use it won't be too hard.

bhserna avatar Jun 29 '15 15:06 bhserna

@bhserna I just migrated one of my projects, and it wasn't hard at all.

kellyselden avatar Jun 29 '15 15:06 kellyselden

If you run into any issues migrating (features that might be missing, a transition document or whatever) open an issue in ember-i18n and ping me in it. I'm happy to help...

rwjblue avatar Jun 29 '15 20:06 rwjblue