Difference between revisions of "Module:Template translation"

add exceptions for Help:Subpages/subpage and friends
>AKlapper (WMF)
m (40 revisions imported from meta:Module:Template_translation: See phab:T231001)
>Shirayuki
(add exceptions for Help:Subpages/subpage and friends)
 
(2 intermediate revisions by 2 users not shown)
Line 38: Line 38:
     and subpage ~= "init"
     and subpage ~= "init"
     and subpage ~= "preload"
     and subpage ~= "preload"
    and subpage ~= "subpage"
    and subpage ~= "subpage2"
    and subpage ~= "sub-subpage"
    and subpage ~= "sub-sub-subpage"
    and subpage ~= "sub-sub-sub-subpage"
     then
     then
         return subpage
         return subpage
Line 65: Line 70:
if not title then
if not title then
-- invalid title
-- invalid title
return nil
return mw.language.getContentLanguage():getCode()
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 88:
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


Anonymous user