From 0919b01e75a2475ebc4af12fb8465b9c9569be56 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sun, 7 Jun 2015 17:30:00 -0700 Subject: [PATCH] Pass uselang=user to the API instead of figuring it out client side Change-Id: I09add693567af577c14c646d2b6b943716e0522e --- modules/overlay/ext.echo.overlay.js | 7 +++---- modules/special/ext.echo.special.js | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/overlay/ext.echo.overlay.js b/modules/overlay/ext.echo.overlay.js index ecb0a5eba..ccdac82a7 100644 --- a/modules/overlay/ext.echo.overlay.js +++ b/modules/overlay/ext.echo.overlay.js @@ -3,8 +3,7 @@ 'use strict'; // backwards compatibility <= MW 1.21 - var getUrl = mw.util.getUrl || mw.util.wikiGetlink, - useLang = mw.config.get( 'wgUserLanguage' ); + var getUrl = mw.util.getUrl || mw.util.wikiGetlink; function EchoOverlay( apiResultNotifications ) { this.api = mw.echo.overlay.api; @@ -87,7 +86,7 @@ data = { action: 'echomarkread', token: mw.user.tokens.get( 'editToken' ), - uselang: useLang + uselang: 'user' }; if ( id ) { // If id is given mark that as read otherwise use all unread messages @@ -469,7 +468,7 @@ notformat: 'flyout', notlimit: this.notificationLimit, notprop: 'index|list|count', - uselang: useLang + uselang: 'user' }; return this.api.get( apiData ).then( function ( result ) { diff --git a/modules/special/ext.echo.special.js b/modules/special/ext.echo.special.js index 89b852733..1d5726ef4 100644 --- a/modules/special/ext.echo.special.js +++ b/modules/special/ext.echo.special.js @@ -1,6 +1,5 @@ ( function ( $, mw ) { 'use strict'; - var useLang = mw.config.get( 'wgUserLanguage' ); mw.echo.special = { @@ -71,7 +70,7 @@ notprop: 'index|list', notcontinue: this.notcontinue, notlimit: mw.config.get( 'wgEchoDisplayNum' ), - uselang: useLang + uselang: 'user' }; api.get( apiData ).done( function ( result ) { @@ -138,7 +137,7 @@ action: 'echomarkread', list: unread.join( '|' ), token: mw.user.tokens.get( 'editToken' ), - uselang: useLang + uselang: 'user' } ).done( function ( result ) { // update the badge if the link is enabled if ( result.query.echomarkread.count !== undefined &&