MediaWiki API help
This is an auto-generated MediaWiki API documentation page.
Documentation and examples: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page
action=setpagelanguage
(main | setpagelanguage)
- This module requires read rights.
- This module requires write rights.
- This module only accepts POST requests.
- Source: MediaWiki
- License: GPL-2.0-or-later
Change the language of a page.
Changing the language of a page is not allowed on this wiki.
Enable $wgPageLanguageUseDB to use this action.
Parameters:
- title
Title of the page whose language you wish to change. Cannot be used together with pageid.
- pageid
Page ID of the page whose language you wish to change. Cannot be used together with title.
- Type: integer
- lang
Language code of the language to change the page to. Use default to reset the page to the wiki's default content language.
- This parameter is required.
- One of the following values: default, ee, egl, el, eml, en, en-ca, en-gb, eo, es, es-formal, et, eu, ext, na, nah, nan, nap, nb, nds, nds-nl, ne, new, nia, niu, nl, nl-informal, nmz, nn, nod, nog, nov, nqo, nrm, nso, nv, ny, nyn, nys
- reason
Reason for the change.
- tags
Change tags to apply to the log entry resulting from this action.
- Values (separate with | or alternative):
- token
A "csrf" token retrieved from action=query&meta=tokens
- This parameter is required.
Examples:
- Change the language of Main Page to Basque.
- api.php?action=setpagelanguage&title=Main%20Page&lang=eu&token=123ABC [open in sandbox]
- Change the language of the page with ID 123 to the wiki's default content language.
- api.php?action=setpagelanguage&pageid=123&lang=default&token=123ABC [open in sandbox]