aldrinbaroi / mediawiki-page-attachment

Automatically exported from code.google.com/p/mediawiki-page-attachment
Other
1 stars 1 forks source link

Internaltionalization/Localization Not Working for Notification Message #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make changes to attachment list on a page that is being watched

What is the expected output? What do you see instead?
Notification message should be in user's preferred language.
Notification message is in Wiki's default language.

Please use labels and text to provide additional information.
To be released PageAttachment versions 1.4.0 & 2.1.0

Original issue reported on code.google.com by Aldrin.Baroi@gmail.com on 1 Mar 2012 at 1:26

GoogleCodeExporter commented 9 years ago

Original comment by Aldrin.Baroi@gmail.com on 1 Mar 2012 at 1:31

GoogleCodeExporter commented 9 years ago
MediaWiki's "Language" & "User" classes are hardcoded to user $wgLang & $wgUser 
variables.  So, instantiating a "Language" with a specified language code 
doesn't help, since, depending on the code execution path, it would start using 
the preferred language settings specified for $wgUser.  Similarly, instatiating 
a "User" class for a specified user id doesn't help, since, depending on the 
code execution path, "Language" instance would be replaced with $wgLang.  

Need to figure out a simple solution, otherwise may have to create similar 
functionality without dependency on $wgUser & $wgLang.

Original comment by Aldrin.Baroi@gmail.com on 3 Mar 2012 at 7:06

GoogleCodeExporter commented 9 years ago
Looks like "Language" class doesn't use setting from $wgUser, at least for 
"timeanddate" method when time correction method parameter is set to false.  At 
least one headache is over; need to test this.

Original comment by Aldrin.Baroi@gmail.com on 3 Mar 2012 at 7:31

GoogleCodeExporter commented 9 years ago
Nope, cann't use "timeanddate" directly, since, in the call chain 
"getDateFormat" uses $wgUser and it would be hard to by pass this.

Maybe used the methods used by "timeanddate" and call them is such a way that 
by pass use of $wgUser?

Original comment by Aldrin.Baroi@gmail.com on 3 Mar 2012 at 8:26

GoogleCodeExporter commented 9 years ago
Looks like there is cyclical dependency between MediaWiki "Language" and "User" 
class and its driving me nuts!!!.  So, I give up!!!  Will create a 
PageAttachment specific "Localization" helper class as a work around.

Original comment by Aldrin.Baroi@gmail.com on 3 Mar 2012 at 8:37

GoogleCodeExporter commented 9 years ago
Fixed:

Created "LocalizationHelper" class to deal with MediaWiki's "Language" and 
"User" class interdependency.

Original comment by Aldrin.Baroi@gmail.com on 3 Mar 2012 at 11:06