[FIX] email message forward fix#7245
Conversation
| const localeFn = Meteor.call('loadLocale', data.language); | ||
| if (localeFn) { | ||
| Function(localeFn)(); | ||
| Function(moment.localeFn)(); |
There was a problem hiding this comment.
This seems like this isn't really solving the problem. The code originally was getting the locale storing it in localeFn and trying to call localeFn as a function. Makes sense why that might not work.
But... with this change you're simply calling a function called localeFn on moment. I don't believe this is actually a valid function.
There was a problem hiding this comment.
Hi, honestly I'm a little clueless with this problem. localeFn contains the content of private/moment-locales/de.js in case of "de" set in user's profile. What does Function(localeFn)(); do then? For testing I removed the complete code between if (data.language !== 'en') { and without it, it's still running with the correct locale set to "de". So what is Function(localeFn)();necessary for then?
There was a problem hiding this comment.
Take a look here:
Rocket.Chat/client/startup/startup.js
Line 76 in d327724
There was a problem hiding this comment.
Aaron,
thanks for your time. I took the code from startup, which works without errors. But it makes no difference, if I remove the complete code lines, which handle the locale stuff. Both is working fine. So what's the code for?
//data.language = data.language.split('-').shift().toLowerCase();
//if (data.language !== 'en') {
// Meteor.call('loadLocale', data.language, (err, localeFn) => {
// Function(localeFn).call({moment});
// moment.locale(data.language);
// });
//}
Ciao
Marcus
There was a problem hiding this comment.
@ggazzo any ideas on this? I know this file was converted from coffeescript to js. So I can't see who wrote the line before or what it used to look like here 😁
There was a problem hiding this comment.
with the upcoming 0.57.2 I'd like to cherry pick this PR. @ggazzo could you give some feedback please. Thanks, Marcus
| @@ -1,1548 +0,0 @@ | |||
| { | |||
There was a problem hiding this comment.
Also please restore this file
There was a problem hiding this comment.
@localguru you'll for sure have to restore this file to resolve the conflicts.
|
|
Please reopen, #7846 doesn't fix it! |
[FIX] email message forward
@RocketChat/core
Closes #6179 #5797
PR fixes email message forwarding if locale in profile is not "en"