Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setlocale issue #245

Open
Maxhodges opened this issue Dec 10, 2016 · 3 comments
Open

setlocale issue #245

Maxhodges opened this issue Dec 10, 2016 · 3 comments

Comments

@Maxhodges
Copy link
Contributor

I get lots of these warnings with the latest version of msgfmt

W20161211-01:37:19.037(9)? (STDERR) 2016-12-11 01:37:11.532 warn:  [msgfmt]  [Q] You called mf() with the key 'order_status_client_authorized' outside of a method/publish and without specifying a locale, defaulting to native (en)

I tried to change lines like this:

Order.statusForClient[Order.status.AUTHORIZED] = mf('order_status_client_authorized', 'UNDER REVIEW');

to this:

Order.statusForClient[Order.status.AUTHORIZED] = mf('order_status_client_authorized', 'UNDER REVIEW', null, 'en');

But it still shows up in as a warning.

Any tips?

@gadicc
Copy link
Owner

gadicc commented Dec 12, 2016

That is... surprising. The function looks like this:

function mf(key, params, message, locale) {
   if (!locale) {  // 1st line!
            ...
            log.warn("You called mf() with the key '" + key...);
            ...
   }
   ...
}

Is there any chance you're calling it in more than one place?

@Maxhodges
Copy link
Contributor Author

we are calling it on the server here i think (meteor method) so I think locale is out-of-context or something.

@gadicc
Copy link
Owner

gadicc commented Dec 12, 2016

Oh I was referring to the fact that even after adding the locale parameter you still get the warning... it shouldn't be possible :) So was wondering if you're running a similar step with the same key elsewhere.

If you just meant you get the warning inside a method without specifying the locale, which should be fine, Meteor might have changed something around DDP and I'll need to take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants