mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-27 17:50:06 +00:00
mw.title: Add pageLanguage property
Bug: T161976 Change-Id: Ifc7a462efb11b28f20ebaad5d62cba8f1f1f8e91
This commit is contained in:
parent
beb0bf8465
commit
602cef87e0
|
@ -139,6 +139,7 @@ class Scribunto_LuaTitleLibrary extends Scribunto_LuaLibraryBase {
|
|||
'isRedirect' => (bool)$title->isRedirect(),
|
||||
'id' => $title->getArticleID(),
|
||||
'contentModel' => $title->getContentModel(),
|
||||
'pageLanguage' => $title->getPageLanguage()->getCode(),
|
||||
];
|
||||
if ( $title->getNamespace() === NS_SPECIAL ) {
|
||||
$ret['exists'] = MediaWikiServices::getInstance()
|
||||
|
|
|
@ -175,6 +175,7 @@ local function makeTitleObject( data )
|
|||
exists = 'e',
|
||||
isRedirect = 'e',
|
||||
contentModel = 'e',
|
||||
pageLanguage = 'e',
|
||||
id = 'e',
|
||||
redirectTarget = true,
|
||||
}
|
||||
|
@ -207,6 +208,9 @@ local function makeTitleObject( data )
|
|||
|
||||
if readOnlyFields[k] == 'e' and data[k] == nil then
|
||||
for k,v in pairs( php.getExpensiveData( t.fullText ) ) do
|
||||
if k == 'pageLanguage' and mw.language then
|
||||
v = mw.language.new( v )
|
||||
end
|
||||
data[k] = v
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue