Module:Template translation: Difference between revisions
Content added Content deleted
m (Changed protection level for "Module:Template translation": Fully protected via cascading protection, autoconfirmed protection is misleading ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))) |
(Add fallback to _getLanguageSubpage for content language. Used by Template:Pagelang) |
||
Line 65: | Line 65: | ||
if not title then |
if not title then |
||
-- invalid title |
-- invalid title |
||
return mw.language.getContentLanguage():getCode() |
|||
return nil |
|||
end |
end |
||
--[[This code does not work in all namespaces where the Translate tool works. |
--[[This code does not work in all namespaces where the Translate tool works. |
||
Line 83: | Line 83: | ||
local titleparts = mw.text.split(title.fullText, '/') |
local titleparts = mw.text.split(title.fullText, '/') |
||
local subpage = titleparts[#titleparts] |
local subpage = titleparts[#titleparts] |
||
return this.checkLanguage(subpage, |
return this.checkLanguage(subpage, mw.language.getContentLanguage():getCode()) |
||
end |
end |
||