پودمان:Infobox road/abbrev/VNM

از پژوهشکده امر به معروف
< پودمان:Infobox road‏ | abbrev
نسخهٔ تاریخ ‏۳۰ اسفند ۱۳۹۱، ساعت ۱۶:۳۳ توسط Happy5214 (نظرات) (Created page with 'local p = {} local format = mw.ustring.format local typesModule = require "Module:Infobox road/abbrev/defs" Country = typesModule.Country Type = typesModule.Ty...')

(تفاوت) → نسخهٔ قدیمی‌تر | نمایش نسخهٔ فعلی (تفاوت) | نسخهٔ جدیدتر ← (تفاوت)
پرش به: ناوبری، جستجو

توضیحات این پودمان می‌تواند در پودمان:Infobox road/abbrev/VNM/توضیحات قرار گیرد.

local p = {}

local format = mw.ustring.format

local typesModule = require "Module:Infobox road/abbrev/defs"
Country = typesModule.Country
Type = typesModule.Type
Abbr = typesModule.Abbr

local abbrs = Country:new()
do -- Abbreviation definitions
    local default = Abbr:new{formatStr = "Đường %s"}
    abbrs.default = default
    
    function abbrs:typeOverride(args)
        local type = args.type or ''
        type = mw.ustring.lower(type)
        return self[type]
    end
    
    do -- National
        local type = Abbr:new{formatStr = "QL %s"}
        abbrs["ql"] = type
        abbrs["quốc lộ"] = type
        abbrs["national"] = type
        abbrs["nation"] = type
    end -- National
    
    do -- Provincial
        local type = Abbr:new{formatStr = "TL %s"}
        abbrs["tl"] = type
        abbrs["tỉnh lộ"] = type
        abbrs["provincial"] = type
        abbrs["province"] = type
    end -- Provincial
    
    do -- District
        local type = Abbr:new{formatStr = "HL %s"}
        abbrs["hl"] = type
        abbrs["hương lộ"] = type
        abbrs["huyện lộ"] = type
        abbrs["district"] = type
    end -- District
    
    do
        local type = Abbr:new{formatStr = "ĐT %s"}
        abbrs["đt"] = type
        abbrs["đường tỉnh"] = type
    end
    
    do
        local type = Abbr:new{formatStr = "ĐH %s"}
        abbrs["đh"] = type
        abbrs["đường huyện"] = type
    end
    
    do -- Towpaths
        local type = Abbr:new{formatStr = "ĐCK %s"}
        abbrs["đck"] = type
        abbrs["đường cặp kênh"] = type
        abbrs["towpath"] = type
    end -- Towpaths
    
end

p.abbrs = abbrs
return p