简体   繁体   中英

How can I update ember-i18n component to work in ember 1.10 with HTMLbars?

My ember 1.8 app is built with grunt CLI and migrating to ember CLI isn't working out, but I'm upgrading to ember 1.10 so can use HTMLbars. The app uses ember-i18n so after loading and resolving models as it transitions to the first View, I get the error 'helper named 't' could not be found'. In 'vendor\\ember-i18n\\lib\\i18n.js' I tried changing 'Handlebars.registerHelper' to 'Ember.HTMLBars._registerHelper', but then I get various 'is undefined' errors out of the i18n component. I read that i18n isn't supported in ember 1.9+ but I need it to work. How can I update it to work in 1.10?

I hadn't realized that my i18n package, which hadn't been updated in a year, and doesn't support the latest Ember compiler, was a forked version (lawitschka). When I switched to the original project, which is up-to-date (jamesarosen), I was able to get my Locale 'label' setup working by changing 'Ember.I18n.set('translations', data)' to 'Ember.I18n.translations = data'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM