Difference between revisions of "Module:Template translation"
Jump to navigation
Jump to search
Module:Template translation (view source)
Revision as of 02:38, 19 December 2015
, 02:38, 19 December 2015rename
>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[' | local namespace = args['tntns'] or '' | ||
if (namespace ~= '') -- Checks for | 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[' | 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 |