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

Support for multiple instances?

Open ragulka opened this issue 8 years ago • 1 comments

I have a somewhat unique use case where I would need a client-side portion of the app (a preview of a document) be in a different locale than the rest of the app. Would this be possible somehow with this package? Also, another use case is to render those documents server-side in a different locale from the rest of the app.

ragulka avatar May 03 '16 17:05 ragulka

Yup! A locale can always be specified on the client (the current locale is used if not):

  • JS: mf(key [,params] [,message] [,locale]);
  • Blaze: {{#mf KEY='key' LOCALE='en_US'}}...{{/mf}}
  • React <MF KEY='key' LOCALE='en_US'>...</MF>

For server side, you have the same JS function, and the Blaze one via the included integration with cmather:handlebars-server. For React I'm not completely sure yet :> (You can open an issue if you want to use react server side and it's not working out).

gadicc avatar May 03 '16 18:05 gadicc