Module:Update history: Difference between revisions

m test with if lang
mNo edit summary
 
(8 intermediate revisions by the same user not shown)
Line 22: Line 22:


function p.getRecentUpdates(frame)
function p.getRecentUpdates(frame)
     local pageName = mw.title.getCurrentTitle().text
     local title = mw.title.getCurrentTitle()
     local pageSuffix = frame:expandTemplate{ title = 'If lang', args = { 'en', '/Update history', 'non-en', '/Update history/{{SUBPAGENAME}}' } }
    local pageName = title.baseText
     local pageTitle = pageName .. pageSuffix
     local lang = frame.args[1] or ''
 
    local pageTitle
    if lang ~= '' then
        pageTitle = pageName .. '/Update history/' .. lang
     else
        pageTitle = pageName .. '/Update history'
    end


     local historyPage = mw.title.new(pageTitle)
     local historyPage = mw.title.new(pageTitle)