Difference between revisions of "Module:Template translation"
Jump to navigation
Jump to search
m
Module:Template translation (view source)
Revision as of 14:44, 22 October 2013
, 14:44, 22 October 2013should be like this, i hope
>Base |
>Base m (should be like this, i hope) |
||
Line 33: | Line 33: | ||
(added for backward compatibility of Template:TNT) | (added for backward compatibility of Template:TNT) | ||
]] | ]] | ||
local namespace = 'Template' | local namespace = 'Template' | ||
local templateFullTitle = mw.title.new(template, namespace) | if (frame.args['namespace']~='')--checks for namespace parameter for custom ns | ||
then | |||
namespace = frame.args['namespace'] | |||
else--supposes that set page is in ns10 | |||
local templateFullTitle = mw.title.new(template, namespace) | |||
if (templateFullTitle.id == 0) | |||
then -- not found in the Template namespace, assume the main namespace | |||
namespace = '' | |||
end | |||
end | end | ||
-- Get the last subpage and check if it matches a known language code | -- Get the last subpage and check if it matches a known language code | ||
local langcode = 'en' -- default language template subpage to render | local langcode = 'en' -- default language template subpage to render |