Module:fa-noun

From Wiktionary, the free dictionary
Jump to navigation Jump to search
This module needs documentation.
Please document this module by describing its purpose and usage on the documentation page.

local m_headword = require("Module:headword")

local export = {}

local lang = require("Module:languages").getByCode("fa")

function export.main(frame)
    local args = frame:getParent().args
    PAGENAME = mw.title.getCurrentTitle().text
    
    local head = args["head"]; if head == "" then head = nil end
    local tr = args["tr"]; if tr == "" then tr = nil end
    
    local inflections = {}
    
    if not tr then
        table.insert(inflections, "<small>([[Wiktionary:Persian transliteration|transliteration needed]])</small>")
        table.insert(categories, "Persian terms lacking transliteration")
    end
    
    return
        m_headword.format_headword(head, lang, "fa-Arab") ..
        m_headword.format_transliteration(tr) ..
        m_headword.format_inflections(inflections, lang, "fa-Arab") ..
        m_headword.format_categories(categories, lang)
end

return export