Last modified: 2013-03-16 14:59:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T48218, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46218 - API enable to guess user language
API enable to guess user language
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.19
All All
: Unprioritized major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-16 14:22 UTC by DavidL
Modified: 2013-03-16 14:59 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description DavidL 2013-03-16 14:22:15 UTC
Here is the recipe to guess the language configured by a user using the API:

* Select a user wiki page where there is some links to some other user page, i.e. containing links like [[User:<sameuser>/<otherpage>]]
* Get last revision of this page using the API
* Links returned from the page content contains links whose namespace is localized to the language configured by the user (ex: [[Utilisateur:...]] for French)

This bug also disallow API usage to process links contained in a page.

Examples:
* https://en.wikibooks.org/w/api.php?action=query&titles=User%3ADavidL%2FSignature&prop=revisions&rvlimit=1&rvdir=newer&rvprop=timestamp%7Cuser%7Ccomment%7Ccontent&format=json
--> DavidL account language set to French because links use "Utilisateur" namespace

* https://en.wikibooks.org/w/api.php?action=query&titles=User%3ABryanBot&prop=revisions&rvlimit=1&rvdir=newer&rvprop=timestamp|user|comment|content&format=json
--> BryanBot account language set to English because links use "User" namespace
Comment 1 Brad Jorsch 2013-03-16 14:49:15 UTC
No, the query for the first revision of User:DavidL/Signature has "Utilisateur" because that's what your bot put into the page: https://en.wikibooks.org/w/index.php?title=User:DavidL/Signature&oldid=2358155&action=edit

If anything in MediaWiki did try to change the links in the rendered wikitext as you claim, it would be entirely broken because "Utilisateur:" isn't a namespace prefix on other-language projects.
Comment 2 DavidL 2013-03-16 14:59:53 UTC
Sorry for not seeing this.
I get confused by rvdir=newer which give the oldest revision.
I misunderstood the meaning of the parameter.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links