meteor-messageformat icon indicating copy to clipboard operation
meteor-messageformat copied to clipboard

Support for handlebars-server

Open friedger opened this issue 11 years ago • 6 comments

with the packge handlebars-server templates can be used on the server, e.g. for email sending or other server responses.

It would be great if I could use mf in these templates on the server as well.

friedger avatar Mar 24 '14 23:03 friedger

If I'm not mistaken, the following should work (but I've never used real Handlebars):

// Without locale it will use the native language.  Params optional
OriginalHandlebars.registerHelper('mf', function(key, message, params, locale) {
  return mf(key, params, message, locale);
});

There's no way to include this in mfPkg itself until 0.9.0 is out which fixes https://github.com/meteor/meteor/issues/1358.

gadicc avatar Mar 25 '14 05:03 gadicc

@gadicc are we still interested in including this? weak dependencies are available :)

DSpeichert avatar Jan 16 '16 16:01 DSpeichert

haha. yay!

gadicc avatar Jan 18 '16 13:01 gadicc

Ok this has a working implementation, for cmather:handlebars-server. For future, we can see if we can avoid things like NAME=NAME by playing around with the OrignialHandlebars context functions. But there's a working example in the README and tests.

gadicc avatar Jan 18 '16 14:01 gadicc

Can we close this issue?

DSpeichert avatar Jan 18 '16 15:01 DSpeichert

Not yet, I definitely want to relook at this. It's milestoned for v2.1 though.

gadicc avatar Jan 28 '16 13:01 gadicc