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

Forcing same language for all users.

Open aviavia opened this issue 8 years ago • 7 comments

Hi, currently the translation looks for logged in users, the "locale" value at the users collection and translates according to it. How do I force it to display only Hebrew? My settings at the moment are: //config.js msgfmt.init('en', { sendPolicy: 'current' }); //settings.json "msgfmt": { "native": "en", "locales": ["he"], "logLevel": "debug" } Thanks, Avi.

aviavia avatar Mar 15 '17 16:03 aviavia

any comment anyone? Thanks.

aviavia avatar Mar 21 '17 09:03 aviavia

Hey @aviavia. Do you think this is the same as #249? I think the simplest way for now is to just add msgfmt.setLocale('he') in the client code (you could probably do it right after msgfmt.init).

gadicc avatar Apr 03 '17 16:04 gadicc

Great, thanks, I'll give it a try.

aviavia avatar Apr 03 '17 16:04 aviavia

I get this error: msgfmt.setLocale is not a function.

aviavia avatar Apr 03 '17 16:04 aviavia

Oh, I guess if you're doing it straight after msgfmt.init(), you probably have that in an isomorphic file, so you'd need some extra code to keep it just on the client, i.e.

if (Meteor.isClient)
  msgfmt.setLocale('he');

gadicc avatar Apr 03 '17 19:04 gadicc

Cool, now it's working. Will check tomorrow if it's ok inside cordova....Thanks!

aviavia avatar Apr 03 '17 20:04 aviavia

Great!

gadicc avatar Apr 04 '17 07:04 gadicc