Closed abate closed 7 years ago
Try UI.registerHelper instead of Template.registerHelper?
nope, same problem ... I looked at blaze code and it should be Blaze.registerHelper
I managed to do it in the end :
The problem was in the initialization, as tap:i18n register all its helpers at Metero.startup . So registering my "_" helper in the startup of my module, solved the problem.
Meteor.startup =>
console.log "Override tap:i18n '_' helper"
Template.deregisterHelper "_"
Template.registerHelper "_", (key) ->
console.log "inline-tapi18n helper"
I18nInline.tr(key)
Hi, I'm writing a small package to make it easy to write translation files. It "should" work, by intercepting all calls to the global helper "_" and adding the (key, tr) tuple to a collection and use this collection to crowd source the translation.
My problem is I'm not able to override the "_" helper.
My naive approach would be to register again the "_" helper in my package (I18nInline) .
But this does not work. I've also tried to unregister the helper first with the same result. My package is loaded after the TAPi18n package, but somehow, my helper is never taken into consideration.
I guess I'm missing something in the loading order, but I can't pinpoint the problem.
Basically I'd like a plug-in to extend the TAPi18n package in a transparent way, use it in development and remove the plugin in production. All this without changing the code of the rest of my application.