Module:Infobox road/abbrev/VNM

MyWikiBiz, Author Your Legacy — Thursday December 26, 2024
Jump to navigationJump to search

Documentation for this module may be created at Module:Infobox road/abbrev/VNM/doc

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