Difference between revisions of "Module:Template translation"

rename
>Philippe (WMF)
m (1 revision imported: import from collabwiki)
>Shirayuki
(rename)
Line 63: Line 63:
     local subpage = titleparts[#titleparts]
     local subpage = titleparts[#titleparts]
     return this.checkLanguage(subpage, '')
     return this.checkLanguage(subpage, '')
end
--[[Get the first part of the language code of the subpage, before the '-'.
    ]]
function this.getMainLanguageSubpage()
parts = mw.text.split( this.getLanguageSubpage(), '-' )
return parts[1]
end
end


Line 134: Line 141:
         ]]
         ]]
     local title
     local title
     local namespace = args['namespace'] or ''
     local namespace = args['tntns'] or ''
     if (namespace ~= '') -- Checks for namespace parameter for custom ns.
     if (namespace ~= '') -- Checks for tntns parameter for custom ns.
     then
     then
         title = this.title(namespace, pagename) -- Costly
         title = this.title(namespace, pagename) -- Costly
Line 236: Line 243:
     end
     end
     arguments['template'] = title -- override the existing parameter of the base template name supplied with the full name of the actual template expanded
     arguments['template'] = title -- override the existing parameter of the base template name supplied with the full name of the actual template expanded
     arguments['namespace'] = nil -- discard the specified namespace override
     arguments['tntns'] = nil -- discard the specified namespace override
     arguments['uselang'] = args['uselang'] -- argument forwarded into parent frame
     arguments['uselang'] = args['uselang'] -- argument forwarded into parent frame
     arguments['noshift'] = args['noshift'] -- argument forwarded into parent frame
     arguments['noshift'] = args['noshift'] -- argument forwarded into parent frame
Anonymous user