meteor-messageformat
meteor-messageformat copied to clipboard
Support for multiple instances?
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.
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).