#2332 add param "uselang" in notifications API calls. (#2555)

The value is the user language. If null or empty the value "user" is used
This commit is contained in:
deniger 2019-03-09 06:13:02 +01:00 committed by Vivek Maskara
parent b673527467
commit a4238c03df

View file

@ -566,6 +566,11 @@ public class ApacheHttpClientMediaWikiApi implements MediaWikiApi {
}else {
notfilter = "!read";
}
String language=Locale.getDefault().getLanguage();
if(StringUtils.isNullOrWhiteSpace(language)){
//if no language is set we use the default user language defined on wikipedia
language="user";
}
notificationNode = api.action("query")
.param("notprop", "list")
.param("format", "xml")
@ -573,6 +578,7 @@ public class ApacheHttpClientMediaWikiApi implements MediaWikiApi {
.param("notformat", "model")
.param("notwikis", "wikidatawiki|commonswiki|enwiki")
.param("notfilter", notfilter)
.param("uselang", language)
.get()
.getNode("/api/query/notifications/list");
} catch (IOException e) {