gadicc / meteor-messageformat

MessageFormat i18n support for Meteor, with reactive templates
54 stars 22 forks source link

language is not changed. #210

Closed aviavia closed 8 years ago

aviavia commented 8 years ago

On config.js I have: msgfmt.init('en', { sendPolicy: 'all' }); navigator.language returns 'he' as expected.

Footer html: {{mf 'support' 'Support'}} {{mf 'privecy' 'privecy'}} {{mf 'termsOfUse' 'Terms of use'}} {{mf 'whoWeAre' 'Who we are'}} and those keys, appear at the list and translated. Yet the footer links are displayed in English. Am I missing anything? Thanks.

gadicc commented 8 years ago

Sorry for delay.

Did you try msgfmt.setLocale('he'); ?

But yes, ideally, we should use or at least the same conclusion as navigator.language, I'm surprised we don't.

Can you amend your init like:

msgfmt.init('en', {
  sendPolicy: 'all',
  logLevel: 'debug'
});

and paste the logs from the browser's JavaScript console after a page reload and after typing msgfmt.resetStorage() ?

That last step is necessary if your user is logged in with the default storeUserLocale option.

aviavia commented 8 years ago

It works for me already. mfPkg.setLocale('he'); I mistakenly replaced mfPkg with a previous name or something, not sure already, thanks.

gadicc commented 8 years ago

Ah ok great! Thanks.