Module:RootFinder

From The Seven Sages of Rome
Revision as of 08:02, 26 March 2025 by Noeth (talk | contribs)

Documentation for this module may be created at Module:RootFinder/doc

local p = {}

function p.getRootLanguage(frame)
    local lang = mw.title.getCurrentTitle().text
    local prop = "Is Variety Of"
    
    while true do
        local parent = mw.smw.getProperty(lang, prop)
        if not parent or parent == "" then
            return lang
        end
        lang = parent
    end
end

return p