Difference between revisions of "Module:Template translation"

Jump to navigation Jump to search
en>Base
m (Undo revision 6105795 by Base (talk))
en>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
    if (templateFullTitle.id == 0)
    then
    then -- not found in the Template namespace, assume the main namespace
    namespace = frame.args['namespace']
        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