Closed GoogleCodeExporter closed 9 years ago
Original comment by Aldrin.Baroi@gmail.com
on 1 Mar 2012 at 1:31
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
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
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
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
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
Original issue reported on code.google.com by
Aldrin.Baroi@gmail.com
on 1 Mar 2012 at 1:26