mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 17:20:40 +00:00
Revert "Pass uselang=user to the API instead of figuring it out client side"
This breaks pages using ?uselang=xx where "xx" is not
the user's language.
This reverts commit 0919b01e75
.
Bug: T103935
Change-Id: I219810451b991cef88bac62cf880bfda6f98e930
This commit is contained in:
parent
bc2c65bbc6
commit
2257dd2a56
|
@ -2,6 +2,8 @@
|
||||||
( function ( $, mw ) {
|
( function ( $, mw ) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var useLang = mw.config.get( 'wgUserLanguage' );
|
||||||
|
|
||||||
function EchoOverlay( apiResultNotifications ) {
|
function EchoOverlay( apiResultNotifications ) {
|
||||||
this.api = mw.echo.overlay.api;
|
this.api = mw.echo.overlay.api;
|
||||||
// set internal properties
|
// set internal properties
|
||||||
|
@ -82,7 +84,7 @@
|
||||||
if ( this.unread.length ) {
|
if ( this.unread.length ) {
|
||||||
data = {
|
data = {
|
||||||
action: 'echomarkread',
|
action: 'echomarkread',
|
||||||
uselang: 'user'
|
uselang: useLang
|
||||||
};
|
};
|
||||||
if ( id ) {
|
if ( id ) {
|
||||||
// If id is given mark that as read otherwise use all unread messages
|
// If id is given mark that as read otherwise use all unread messages
|
||||||
|
@ -458,7 +460,7 @@
|
||||||
notformat: 'flyout',
|
notformat: 'flyout',
|
||||||
notlimit: this.notificationLimit,
|
notlimit: this.notificationLimit,
|
||||||
notprop: 'index|list|count',
|
notprop: 'index|list|count',
|
||||||
uselang: 'user'
|
uselang: useLang
|
||||||
};
|
};
|
||||||
|
|
||||||
return this.api.get( apiData ).then( function ( result ) {
|
return this.api.get( apiData ).then( function ( result ) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
( function ( $, mw ) {
|
( function ( $, mw ) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
var useLang = mw.config.get( 'wgUserLanguage' );
|
||||||
|
|
||||||
mw.echo.special = {
|
mw.echo.special = {
|
||||||
|
|
||||||
|
@ -67,7 +68,7 @@
|
||||||
notprop: 'index|list',
|
notprop: 'index|list',
|
||||||
notcontinue: this.notcontinue,
|
notcontinue: this.notcontinue,
|
||||||
notlimit: mw.config.get( 'wgEchoDisplayNum' ),
|
notlimit: mw.config.get( 'wgEchoDisplayNum' ),
|
||||||
uselang: 'user'
|
uselang: useLang
|
||||||
};
|
};
|
||||||
|
|
||||||
api.get( apiData ).done( function ( result ) {
|
api.get( apiData ).done( function ( result ) {
|
||||||
|
@ -129,7 +130,7 @@
|
||||||
api.postWithToken( 'edit', {
|
api.postWithToken( 'edit', {
|
||||||
action: 'echomarkread',
|
action: 'echomarkread',
|
||||||
list: unread.join( '|' ),
|
list: unread.join( '|' ),
|
||||||
uselang: 'user'
|
uselang: useLang
|
||||||
} ).done( function ( result ) {
|
} ).done( function ( result ) {
|
||||||
// update the badge if the link is enabled
|
// update the badge if the link is enabled
|
||||||
if ( result.query.echomarkread.count !== undefined &&
|
if ( result.query.echomarkread.count !== undefined &&
|
||||||
|
|
Loading…
Reference in a new issue