mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +00:00
Pass uselang=user to the API instead of figuring it out client side
Change-Id: I09add693567af577c14c646d2b6b943716e0522e
This commit is contained in:
parent
10cd92a326
commit
0919b01e75
|
@ -3,8 +3,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// backwards compatibility <= MW 1.21
|
// backwards compatibility <= MW 1.21
|
||||||
var getUrl = mw.util.getUrl || mw.util.wikiGetlink,
|
var getUrl = mw.util.getUrl || mw.util.wikiGetlink;
|
||||||
useLang = mw.config.get( 'wgUserLanguage' );
|
|
||||||
|
|
||||||
function EchoOverlay( apiResultNotifications ) {
|
function EchoOverlay( apiResultNotifications ) {
|
||||||
this.api = mw.echo.overlay.api;
|
this.api = mw.echo.overlay.api;
|
||||||
|
@ -87,7 +86,7 @@
|
||||||
data = {
|
data = {
|
||||||
action: 'echomarkread',
|
action: 'echomarkread',
|
||||||
token: mw.user.tokens.get( 'editToken' ),
|
token: mw.user.tokens.get( 'editToken' ),
|
||||||
uselang: useLang
|
uselang: 'user'
|
||||||
};
|
};
|
||||||
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
|
||||||
|
@ -469,7 +468,7 @@
|
||||||
notformat: 'flyout',
|
notformat: 'flyout',
|
||||||
notlimit: this.notificationLimit,
|
notlimit: this.notificationLimit,
|
||||||
notprop: 'index|list|count',
|
notprop: 'index|list|count',
|
||||||
uselang: useLang
|
uselang: 'user'
|
||||||
};
|
};
|
||||||
|
|
||||||
return this.api.get( apiData ).then( function ( result ) {
|
return this.api.get( apiData ).then( function ( result ) {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
( function ( $, mw ) {
|
( function ( $, mw ) {
|
||||||
'use strict';
|
'use strict';
|
||||||
var useLang = mw.config.get( 'wgUserLanguage' );
|
|
||||||
|
|
||||||
mw.echo.special = {
|
mw.echo.special = {
|
||||||
|
|
||||||
|
@ -71,7 +70,7 @@
|
||||||
notprop: 'index|list',
|
notprop: 'index|list',
|
||||||
notcontinue: this.notcontinue,
|
notcontinue: this.notcontinue,
|
||||||
notlimit: mw.config.get( 'wgEchoDisplayNum' ),
|
notlimit: mw.config.get( 'wgEchoDisplayNum' ),
|
||||||
uselang: useLang
|
uselang: 'user'
|
||||||
};
|
};
|
||||||
|
|
||||||
api.get( apiData ).done( function ( result ) {
|
api.get( apiData ).done( function ( result ) {
|
||||||
|
@ -138,7 +137,7 @@
|
||||||
action: 'echomarkread',
|
action: 'echomarkread',
|
||||||
list: unread.join( '|' ),
|
list: unread.join( '|' ),
|
||||||
token: mw.user.tokens.get( 'editToken' ),
|
token: mw.user.tokens.get( 'editToken' ),
|
||||||
uselang: useLang
|
uselang: 'user'
|
||||||
} ).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