-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[FIX] email message forward fix #7245
Conversation
@@ -55,7 +55,7 @@ Meteor.methods({ | |||
if (data.language !== 'en') { | |||
const localeFn = Meteor.call('loadLocale', data.language); | |||
if (localeFn) { | |||
Function(localeFn)(); | |||
Function(moment.localeFn)(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look here:
Rocket.Chat/client/startup/startup.js
Line 76 in d327724
Function(localeFn).call({moment}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please restore this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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"