Module:Template translation: Difference between revisions
Content added Content deleted
m (frame:expandTemplate() still incorrectly assumes a default "Template:" namespace, even when passing a full title object and not a page name) |
mNo edit summary |
||
Line 21: | Line 21: | ||
]] |
]] |
||
function this.getLanguageSubpage() |
function this.getLanguageSubpage() |
||
--[[This code does not work ib all namespaces where the Translate tool works. |
|||
⚫ | |||
-- It works in the main namespace on Meta because it allows subpages there |
|||
⚫ | |||
-- It would not work in the main namespace of English Wikipedia (but the |
|||
-- articles are monolignual on that wiki). |
|||
-- On Meta-Wiki the main space uses subpages and its pages are translated. |
|||
-- The Translate tool allows translatng pages in all namespaces, even if |
|||
-- the namespace officially does not have subpages. |
|||
-- On Meta-Wiki the Category namespace still does not have subpages enabled, |
|||
-- even if they would be very useful for categorizing templates, that DO have |
|||
-- subpages (for documentatio and tstboxes pages). This is a misconfiguration |
|||
-- bug of Meta-Wiki. The work-around is to split the full title and then |
|||
-- get the last titlepart. |
|||
⚫ | |||
--]] |
|||
local titleparts = mw.text.split(mw.title.getCurrentTitle().fullText, '/') |
|||
local subpage = titleparts[#titleparts] |
|||
⚫ | |||
end |
end |
||