夏季吃什么水果好| 厕所里应该摆什么花| 肺部硬结灶是什么意思| 阿甘正传珍妮得了什么病| 胎盘0级是什么意思啊| 牛肉和什么菜包饺子好吃| 绕行是什么意思| 金酒兑什么好喝| 什么是肝阳上亢| 什么米不能吃| 什么游戏赚钱| 梦见下雨是什么预兆| 小孩白头发是什么原因引起的| 半夜醒是什么原因| 冲击波治疗有什么效果| 来曲唑片是什么药| 高考成绩什么时间公布| 脖子淋巴结肿大是什么原因| 甲状腺什么原因引起的| 来例假喝红糖水有什么好处| 蛊是什么| 艾灸是什么东西| 把握时机是指什么生肖| 口臭是什么原因造成的| 海盐是什么盐| 鸡吃什么| 哗众取宠是什么意思| 为什么会有盆腔积液| 婴儿什么时候会说话| 天成是什么意思| dos是什么| 糖异生是什么意思| bigbang什么意思| 吃饭恶心是什么原因| 小孩自闭症是什么原因引起的| 女生有喉结是什么原因| 别来无恙什么意思| 病毒感染吃什么消炎药| 逆流而上是什么意思| 大米里放什么不生虫子| 强身之道的强是什么意思| 长沙有什么山| 六畜大宝在农家是什么生肖| 令堂是什么意思| 搭桥和支架有什么区别| 长绒棉是什么面料| 乙肝疫苗什么时候打| 上腹胀是什么原因| 飞舞是什么意思| 考军校要什么条件| 沙姜是什么姜| 什么什么和谐| 一点是什么时辰| 胃动力不足是什么原因造成的| 寄生茶在什么树上最好| 吃什么长高| 花心是什么意思| 鱿鱼不能和什么一起吃| 1944年属什么| 什么时候测血压最准确| 宫缩什么感觉| 阴茎供血不足吃什么药| 1946年属什么生肖| 颈动脉斑块挂什么科| 什么人不能吃桃子| 频繁打喷嚏是什么原因| 长痘痘擦什么药膏好| 自律性是什么意思| 氨是什么| 七月十四是什么节| 脑软化灶是什么意思| 双鱼男喜欢什么样的女生| 梦见买车是什么意思| 舌头上火吃什么药| 嗓子疼吃什么水果好| 景五行属性是什么| 腹泻吃什么药最有效| 晨尿有泡沫是什么原因| 螃蟹代表什么生肖| 榴莲有什么好处| 小便憋不住尿裤子是什么情况| 什么不能带上高铁| 久而久之下一句是什么| tim是什么| py什么意思| 全身而退是什么意思| 困水是什么意思| 做b超前需要注意什么| 大美是什么意思| 梦见很多小孩是什么意思| 下海是什么意思| 梦见蝎子是什么预兆| 扁平疣是什么| 糖耐什么时候做| 脸黑的人适合穿什么颜色的衣服| 线性骨折是什么意思| 牙痛是什么原因引起的| 干咳喝什么药| 什么书好看| 眼睛发痒是什么原因| 咯痰是什么意思| 咳嗽白痰吃什么药| 梦见买白菜是什么意思| hvb是什么意思| 什么堂大什么| 什么生意好做又赚钱| 说辞是什么意思| 梦见盗墓是什么意思| 弥勒佛为什么是未来佛| 干咳无痰是什么原因引起的| 脑供血不足用什么药好| o型血和ab型血生的孩子是什么血型| 晚上饿了吃什么不长胖| qt是什么意思| 拜谒是什么意思| 9月30日什么星座| 豆芽不能和什么一起吃| 急性湿疹用什么药膏| 生产是什么意思| 荔枝不能和什么一起吃| 耳朵响是什么原因引起的| 肺有问题会出现什么症状| 泌乳素高有什么症状表现| 牙齿总是出血是什么原因| 农合是什么| 尿微量白蛋白高吃什么药| 癫痫病是什么原因引起的| 智齿发炎吃什么消炎药| 打激素有什么副作用| 胎位不正是什么原因导致的| 如果你是什么就什么造句| 脑血管痉挛吃什么药| 脂肪瘤是什么引起的| 什么药治便秘最好最快| 鼠目寸光是什么意思| 月经是黑色的是什么原因| 不经意间是什么意思| 脚冰凉是什么原因| 珊瑚色是什么颜色| 胆汁反流用什么药好| 王母娘娘姓什么| 炸鸡用什么油| 虾米是什么意思| 温存是什么意思| 梦见数字是什么意思| 肢体麻木是什么原因| 敬邀是什么意思| 化险为夷的夷什么意思| 最里面的牙齿叫什么牙| 日本有什么好玩的| 男人为什么会遗精| 清新的什么填空| 十月二十五是什么星座| 孕妇过敏可以用什么药| 什么时候测血压最准确| 产妇月子吃什么下奶多| 女人梦见血是什么预兆| 圆脸适合什么镜框| 赤潮是什么| 什么的雪花| 输氨基酸对身体有什么好处和坏处| 碱性磷酸酶偏低是什么原因| 诸葛亮老婆叫什么名字| 为什么会缺乏维生素d| 宫颈管短有什么症状| 为什么不能在一起| 怀孕前期有什么征兆| 血糖高的人能吃什么水果| 拉架棉是什么面料| 绝育手术对女性有什么危害| 爬高上低是什么意思| 蜜蜡属于什么五行属性| youtube是什么软件| 车前草是什么| 轴位是什么意思| 尿蛋白尿潜血同时出现说明什么| 夜尿多吃什么药效果好| 念旧的人是什么样的人| 古着店是什么意思| 男人纹身纹什么运气好| 荨麻疹吃什么药效果好| 悲伤是什么意思| 锋芒毕露是什么意思| 维生素b3又叫什么| 岳绮罗是什么来历| 蓝色属于什么五行属性| 最小的动物是什么| 子宫内膜厚有什么影响| 七年是什么婚| 什么叫银屑病| smt是什么意思| 中国的国树是什么树| 来大姨妈不能吃什么水果| 心脏跳动过快吃什么药| 眼睑痉挛挂什么科| 4月4日什么星座| 什么是cos| 吃羊肉不能吃什么水果| 低密度脂蛋白偏高是什么意思| 浑水摸鱼是什么意思| 长乘宽乘高算的是什么| 连长相当于地方什么官| 脚抽筋吃什么钙片好| 性侵是什么意思| 中国什么姓氏人口最多| 淋巴结是什么原因引起的| 姐姐的女儿应该叫什么| 干扰素是什么| 7.7是什么星座| 生理期腰疼是什么原因| 入职需要准备什么材料| 肾结石吃什么比较好| 头痛呕吐什么原因| 血常规血红蛋白偏高是什么原因| 4月13号是什么星座| 时间短吃什么药| b超是查什么的| 苹果5s什么时候上市的| asus是什么牌子| 耳朵堵塞感是什么原因| 007最新一部叫什么| 心不在焉什么意思| 新疆有什么烟| 支原体感染吃什么食物好| 第三者责任险是什么意思| 领结婚证需要什么| 鞘膜积液是什么病| 梦见种地是什么意思| 长辈生日送什么好| 迷糊是什么意思| 七宗罪都是什么| 肝脏是什么器官| 曲安奈德针治疗什么| 唱过什么歌| 为什么星星会眨眼| 熠字五行属什么| 三点水的字有什么| 润滑油是干什么用的| 存货是什么| 9月14是什么星座| 小猫的特点是什么| 滨海新区有什么好玩的地方| 9月24日是什么星座| 水晶是什么材质| 山楂干泡水喝有什么功效| 狗舔人是什么意思| 水对什么| 尿素氮肌酐比值偏高是什么原因| 半边脸肿是什么原因| 港股通是什么| 新生儿屁多是什么原因| 如火如荼是什么意思| 宝宝便秘吃什么好| 脸上长痘痘用什么药膏效果好| mcm中文叫什么牌子| 射手男喜欢什么样的女生| 黄墙绿地的作用是什么| 什么地跑步| 吃什么通血管| 生育能力检查挂什么科| 哪吒是什么意思| 梦见鞋丢了是什么意思| 脖子长痘痘是因为什么原因| 木字旁有什么字| 百度Zum Inhalt springen

歌迷点写给蔡依林的歌 周杰伦机智回应

aus Wikipedia, der freien Enzyklop?die
Vorlagenprogrammierung Diskussionen Lua Unterseiten
Modul Deutsch 百度 最近有传闻称,苹果将自主开发LED屏幕,这也是需要大手笔资金投入的。

Modul: Dokumentation

Diese Seite enth?lt Code in der Programmiersprache Lua. Einbindungszahl Cirrus

Dies ist die (produktive) Mutterversion eines global benutzten Lua-Moduls.
Wenn die serial-Information nicht übereinstimmt, müsste eine Kopie hiervon in das lokale Wiki geschrieben werden.
Versionsbezeichnung auf WikiData: 2025-08-07

local Export = { serial = "2025-08-07",
                 suite  = "lang",
                 item   = 26826825 }
--[=[
Vorlage:lang und Sprachnamenvorlagen usw. unterstützen
]=]
local Failsafe  = Export
local GlobalMod = Export



local Config = {
   errCat        = false,
   errClass      = "error_lang",
   errClasses    = false,
   errHide       = true,
   errNS         = false,
   errDoubled    = { en = "Doubled:",
                     de = "Doppelangabe:" },
   errEmpty      = { en = "Empty parameter value",
                     de = "Parameterwert fehlt" },
   errInvalid    = { en = "Invalid:",
                     de = "Ungültig:" },
   errMissing    = { en = "Missing parameter",
                     de = "Parameter fehlt" },
   errSuggest    = { en = "'%s' * probably '%s' intended",
                     de = "'%s' * vermutlich ist '%s' gemeint" },
   errUnkown     = { en = "Unkown parameter:",
                     de = "Parameter unbekannt:" },
   ipa           = "IPA",
   keyBase       = 100,
   keyProject    = 200,
   keyAncient    = 300,
   keyTranslate  = 400,
   params        = { "Text1",
                     "Audio",
                     "IPA",
                     "class",
                     "lenient",
                     "script",
                     "style",
                     "nachgestellt",
                     "demo",
                     "demo2",
                     "demo3",
                     "demo4",
                     "NoCat" },
   percents      = false,
   orderOther    = { grc = 1,
                     hbo = 2,
                     la  = 3,
                     en  = 9 },
   owns          = { de = "‚%s‘" },
   sepComma      = "Latn Armn Cyrl Grek Thai",
   site          = "Latn",
   tmplAudio     = false,    -- template for media player link
   tmplLang      = false,    -- template for language name link
   tmplStyles    = false,
   wikidata      = { Multilingual       = 47541920,
                     ISO15924           = 71584769,
                     ["ISO15924/codes"] = 71840276,
                     TemplUtl           = 52364930 }
}



local foreignModule = function ( access, advanced, append, alt, alert )
    -- Fetch global module
    -- Precondition:
    --     access    -- string, with name of base module
    --     advanced  -- true, for require(); else mw.loadData()
    --     append    -- string, with subpage part, if any; or false
    --     alt       -- number, of wikidata item of root; or false
    --     alert     -- true, for throwing error on data problem
    -- Postcondition:
    --     Returns whatever, probably table
    -- 2025-08-07
    local storage = access
    local finer = function ()
                      if append then
                          storage = string.format( "%s/%s",
                                                   storage,
                                                   append )
                      end
                  end
    local fun, lucky, r, suited
    if advanced then
        fun = require
    else
        fun = mw.loadData
    end
    GlobalMod.globalModules = GlobalMod.globalModules or { }
    suited = GlobalMod.globalModules[ access ]
    if not suited then
        finer()
        lucky, r = pcall( fun,  "Module:" .. storage )
    end
    if not lucky then
        if not suited  and
           type( alt ) == "number"  and
           alt > 0 then
            suited = string.format( "Q%d", alt )
            suited = mw.wikibase.getSitelink( suited )
            GlobalMod.globalModules[ access ] = suited or true
        end
        if type( suited ) == "string" then
            storage = suited
            finer()
            lucky, r = pcall( fun, storage )
        end
        if not lucky and alert then
            error( "Missing or invalid page: " .. storage, 0 )
        end
    end
    return r
end -- foreignModule()



local function Fetch( ask )
    -- Fetch module (require)
    -- Parameter:
    --     ask  -- string, with name
    --                     "ISO15924"
    --                     "Multilingual"
    --                     "TemplUtl"
    -- Returns string, with error message, if not available
    local ext = Config[ ask ]
    local r
    if not ext  and  ext ~= false then
        ext = foreignModule( ask,
                             true,
                             false,
                             Config.wikidata[ ask ] )
        if type( ext ) == "table" then
            Config[ ask ] = ext
            if type( ext[ ask ] ) == "function" then
                Config[ ask ] = ext[ ask ]()
            end
        end
        if type( Config[ ask ] ) ~= "table" then
            Config[ ask ] = false
            if not ext then
                ext = "Invalid library *** Module:" .. ask
            end
            ext = mw.html.create( "span" )
                         :attr( "class", "error" )
                         :wikitext( ext )
            r = tostring( ext )
        end
    end
    return r
end -- Fetch()



local function Frame()
    -- Fetch current frame
    -- Returns frame
    if not Config.frame then
        Config.frame = mw.getCurrentFrame()
    end
    return Config.frame
end -- Frame()



local function Friend()
    -- Fetch Module:ISO15924/codes
    if not Config.codesISO15924 then
        Config.codesISO15924 = foreignModule( "ISO15924",
                                              false,
                                              "codes",
                                              Config.wikidata.ISO15924 )
        if type( Config.codesISO15924 ) ~= "table" then
            Config.codesISO15924 = { }
        end
    end
    return Config.codesISO15924
end -- Friend()



local function Fulfil( access, args )
    -- Expand template
    --     apply  -- string, with template name
    --     args   -- table, with parameters
    -- Returns string
    -- Throws error, if template not existing
    return Frame():expandTemplate{ title = access,
                                   args  = args }
end -- Fulfil()



local function facet( assign )
    -- Format language name
    --     apply  -- string, with language name, might be linked
    -- Returns string
    local e = mw.html.create( "span" )
                     :css( { ["font-style"]  = "normal",
                             ["font-weight"] = "normal" } )
                     :wikitext( assign )
    return tostring( e )
end -- facet()



local function facility()
    -- Fetch current site language
    -- Returns language code
    if not Config.standard then
        Config.standard = mw.language.getContentLanguage():getCode()
    end
    return Config.standard
end -- facility()



local function factory( apply )
    -- Localization of messages
    --     apply  -- string, with message key
    -- Returns message text; at least english
    local entry = Config[ apply ]
    local r
    if entry then
        r = entry[ facility() ]
        if not r then
            r = entry.en
        end
    else
        local e = mw.html.create( "span" )
                         :attr( "class", "error" )
                         :wikitext( string.format( "????.%s.????",
                                                   apply ) )
        r = tostring( e )
    end
    return r
end -- factory()



local function faculty( adjust )
    -- Test template arg for boolean
    --     adjust  -- string or nil
    -- Returns boolean
    local s = type( adjust )
    local r
    if s == "string" then
        r = mw.text.trim( adjust )
        r = ( r ~= ""  and  r ~= "0"  and  r ~= "-" )
    elseif s == "boolean" then
        r = adjust
    else
        r = false
    end
    return r
end -- faculty()



local function familiar( ask, assign )
    -- Check whether valid transcription for context
    --     ask     -- string, with transcription code
    --     assign  -- string or nil, with language or scripting key
    -- Returns boolean
    local r
    Fetch( "ISO15924" )
    if Config.ISO15924 then
        r = Config.ISO15924.isTrans( ask, assign, Config.site )
    end
    return r
end -- familiar()



local function family()
    -- attempt to load local config
    if not Config.data then
        local sub = string.format( "%s/config", Frame():getTitle() )
        local lucky
        lucky, Config.data = pcall( mw.loadData, sub )
        if type( Config.data ) == "table" then
            for k, v in pairs( Config.data ) do
                Config[ k ] = v
            end -- for k, v
        else
            Config.data = sub .. " not found"
        end
    end
end -- family()



local function fault( alert, about, assign )
    -- Format message with class="error" or similar
    --     alert   -- string, with message key
    --     about   -- string, with explanation
    --     assign  -- true, when standard category to be fired
    -- Returns message with markup
    local story = factory( alert )
    local env   = Frame():getParent()
    local err   = mw.html.create( "span" )
    local r
    err:addClass( Config.errClass )
       :css( { ["margin-left"]  = "1em",
               ["margin-right"] = "1em" } )
    family()
    if env then
        story = string.format( "[[%s]] – %s",
                               env:getTitle(), story )
    end
    if about then
        story = string.format( "%s %s", story, about )
    end
    if Config.errClasses then
        err:addClass( Config.errClasses )
    end
    err:wikitext( story )
    r = Fetch( "TemplUtl" )
    if Config.TemplUtl then
        r = Config.TemplUtl.failure( tostring( err ),
                                     not Config.errHide,
                                     false,
                                     Frame() )
    end
    if assign  and  type( Config.errCat ) == "string" then
        if Config.errNS then
            local ns = mw.title.getCurrentTitle().namespace
            local st = type( Config.errNS )
            if st == "string" then
                local space  = string.format( ".*%%s%d%%s.*", ns )
                local spaces = string.format( " %s ", Config.errNS )
                if spaces:match( space ) then
                    Config.errNS = false
                end
            elseif st == "table" then
                for i = 1, #Config.errNS do
                    if Config.errNS[ i ] == ns then
                        Config.errNS = false
                        break    -- for i
                    end
                end -- for i
            end
        end
        if not Config.errNS then
            r = string.format( "%s[[Category:%s]]", r, Config.errCat )
        end
    end
    return r
end -- fault()



local function features( apply, assign )
    -- Equip element with script attributes
    --     apply   -- mw.html element
    --     assign  -- string, with script code
    if type( Config.percents ) == "table" then
        local more = Config.percents[ assign ]
        if more then
            apply:css( "font-size",  string.format( "%d%%", more ) )
        end
    end
end -- features()



local function fill( apply )
    -- Expand language name template
    --     apply   -- string, with code
    -- Returns string, identical apply in case of error
    local r = apply
    local template
    family()
    template = Config.tmplLang
    if type( template ) == "table" then
        local source = template.title
        if type( source ) ~= "string" then
            if type( template.namePat ) == "string"  and
               template.namePat:find( "%s", 1, true ) then
                source = string.format( template.namePat, apply )
            end
        end
        if type( source ) == "string" then
            local lucky, s = pcall( Fulfil, source )
            if lucky then
                r = s
            end
        end
    end
    return r
end -- fill()



local function first( assign, apply )
    -- Equip element with TemplateStyles
    --     assign  -- string, with script code
    --     apply   -- mw.html element, or false
    -- Returns string, perhaps with tag
    local r
    if type( Config.tmplStyles ) == "table" then
        local source = Config.tmplStyles[ assign ]
        if source then
            r = Frame():extensionTag( "templatestyles",
                                      nil,
                                      { src = source } )
            if apply then
                apply:wikitext( r )
            end
        end
    end
    return r or ""
end -- first()



local function fit( acquire )
    -- Retrieve script code for language
    --     acquire  -- string, with language code
    -- Returns string or false
    local r
    local iso639script = Friend().iso639script
    if type( iso639script ) == "table" then
        r = iso639script[ acquire ]
        if type( r ) == "table" then
            r = r[ 1 ]
        end
    end
    return r
end -- fit()



local function flag( already, apply )
    -- Check whether space separated classes contain
    --     already  -- string or false, with classes
    --     apply    -- string or false, with single class
    -- Returns true, if apply is in already
    local r
    if already then
        if apply then
            local classes = mw.text.split( already, "%s+" )
            local plus    = mw.text.split( apply, "%s+" )
            local single
            for i = 1, #plus do
                single = plus[ i ]
                for k = 1, #classes do
                    if classes[ k ] == single then
                        single = false
                        break -- for k
                    end
                end -- for k
                if single then
                    table.insert( classes, single )
                end
            end -- for i
            r = table.concat( classes, " " )
        else
            r = already
        end
    else
        r = apply
    end
    return r
end -- flag()



local function flatten( apply )
    -- Trim any whitespace, even HTML encoded
    --     apply   -- string
    -- Returns string, or false if empty
    local r = apply
    if r:find( "&" ) then
        r = r:gsub( " ",    " " )
             :gsub( " ", " " )
             :gsub( "‌",   "‌" )
             :gsub( "‍",    "‍" )
             :gsub( "‎",    "‎" )
             :gsub( "‏",    "‏" )
        if r:find( "&#" ) then
            local f = function ( ax, an )
                          local k
                          if ax == "x" then
                              k = 16
                          else
                              k = 10
                          end
                          return mw.ustring.char( tonumber( an, k ) )
                      end
            r = r:gsub( "&#(x?)(%x+);",  f )
        end
    end
    if not Config.patternWS then
        Config.patternWS = mw.ustring.char(   91,
                                               1, 45, 32,
                                             160,
                                            8194, 45, 8207,
                                            8239,
                                              93,
                                              43 )
    end
    r = mw.ustring.gsub( r,  "^" .. Config.patternWS,  "" )
    r = mw.ustring.gsub( r,  Config.patternWS .. "$",  "" )
    if r == "" then
        r = false
    end
    return r
end -- flatten()



local function follow( affine )
    -- Retrieve appropriate separator
    --     affine    -- string or nil, with code of script
    -- Returns string, with separator (comma) or not
    local r
    if affine then
        if Config.sepComma:find( affine, 1, true ) then
            r = ","
        else
            r = ""
        end
    else
        r = ","
    end
    return r
end -- follow()



local function foreign( apply, acquire, advanced, affine )
    -- Format text in some language
    --     apply     -- string, with text
    --     acquire   -- string, with basic code of language
    --     advanced  -- string, with full code of language
    --     affine    -- string or nil, with code of script
    -- Returns string
    local story  = apply
    local script = affine
    local p = { ["font-weight"] = "normal" }
    local ltr, r
    if advanced == acquire then
        ltr = not mw.language.new( acquire ):isRTL()
    elseif not script  and  advanced:find( "-", 3, true ) then
        local parts = mw.text.split( advanced, "-", true )
        if #parts > 1  and  parts[ 2 ]:match( "^%u%l%l%l$" ) then
            script = parts[ 2 ]
        end
    end
    if script then
        local rtl = Friend().rtl
        if type( rtl ) == "table" then
            ltr = not rtl[ script ]
        end
    end
    if ltr then
        local e = mw.html.create( "span" )
                         :attr( "lang", advanced )
        local s = "normal"
        if acquire == facility()
           and Config.owns[ acquire ]  then
            story = string.format( Config.owns[ acquire ], apply )
        elseif advanced == acquire  and  Config.site == "Latn"   or
               advanced == acquire .. "-Latn" then
            s = "italic"
        end
        p["font-style"] = s
        e:css( p )
         :wikitext( story )
        r = tostring( e )
    else
        p["font-style"] = "normal"
        r = Export.fold( { css       = p,
                           SCRIPTING = script },
                         { [ 1 ] = acquire,
                           [ 2 ] = apply,
                           lang  = advanced } )
    end
    return r
end -- foreign()



local function foreigns( ahead, aliens, alone )
    -- Create list of translations
    --     ahead   -- string, with leading separator
    --     aliens  -- sequence table, with assignment tables
    --     alone   -- boolean, no other elements in collection yet
    -- Returns string, starting with separator (comma)
    local pars = { }
    local sep  = ahead
    local lone = alone
    local r    = ""
    local k, lucky, s, t
    family()
    facility()
    Fetch( "Multilingual" )
    for i = 1, #aliens do
        t = aliens[ i ]
        if t.short == Config.standard then
            t.m = Config.keyProject
            t.n = 0
        else
            k = Config.orderOther[ t.short ]
            if k then
                t.n = k
                t.m = Config.keyAncient
            end
            lone = false
        end
        t.n = t.m + t.n
    end -- for i
    table.sort( aliens,
                function ( a1, a2 )
                    return ( a1.n < a2.n )
                end )
    for i = 1, #aliens do
        t = aliens[ i ]
        if lone then
            s   = ""
            sep = ""
        else
            s = false
            if t.short == Config.slang  and
               t.script  and
               t.n > 0 then
                Fetch( "ISO15924" )
                if Config.ISO15924 then
                    s = Config.ISO15924.scriptName( t.script )
                    if s == t.script then
                        s = false
                    end
                end
            end
            if not s  and  t.n > Config.keyProject then
                s = fill( t.short )
            end
            if not s then
                Fetch( "Multilingual" )
                s = mw.language.fetchLanguageName( t.short,
                                                   Config.standard )
                if Config.Multilingual  and
                   Config.Multilingual.isMinusculable( s ) then
                    s = mw.ustring.lower( mw.ustring.sub( s, 1, 1 ) )
                        .. mw.ustring.sub( s, 2 )
                end
            end
        end
        r   = string.format( "%s%s %s %s",
                             r,
                             sep,
                             s,
                             foreign( t.story,
                                      t.short,
                                      t.slang,
                                      t.script ) )
        sep = follow( t.script )
    end -- for i
    return r
end -- foreigns()



local function friend( assigned, apply )
    -- Transcription unit
    --     assigned  -- string, transcription ID
    --     apply     -- string, transcription text
    -- Returns string
    local e = mw.html.create( "span" )
                     :addClass( Config.site )
                     :attr( "lang",
                            string.format( "%s-%s",
                                           Config.slang,
                                           Config.site ) )
                     :css( { ["font-weight"] = "normal" } )
                     :wikitext( apply )
    local r, s
    if Config.site == "Latn" then
        s = "italic"
    else
        s = "normal"
    end
    e:css( { ["font-style"] = s } )
    if type( Config.transys ) == "table"  and
       type( Config.transys[ assigned ] ) == "table" then
        local transys = Config.transys[ assigned ]
        if transys.class then
            e:addClass( transys.class )
        end
        if transys.show then
            s = transys.show
        else
            s = assigned
        end
        if transys.support then
            if s == transys.support then
                s = string.format( "[[%s]]", s )
            else
                s = string.format( "[[%s|%s]]", transys.support, s )
            end
        end
    else
        s = assigned
    end
    r = string.format( "%s %s%s",
                       s,  first( Config.site ),  tostring( e ) )
    return r
end -- friend()



local function frontend( action, argsF, argsT, about )
    -- Template service
    --     action  -- string, "flat" or "full" etc.
    --     argsF   -- table, with #invoke parameters, or false
    --     argsT   -- table, with template parameters
    --     about   -- string or nil, invocation name
    -- Returns frame
    local lucky, r
    lucky, r = pcall( Export[ action ], argsF, argsT )
    if not lucky then
        local e = mw.html.create( "span" )
                         :attr( "class", "error" )
        if about then
            r = string.format( "&#123;{%s}&#125; %s",  about,  r )
        end
        e:wikitext( r )
        r = tostring( e )
    end
    return r
end -- frontend()



local function frontier( frame, action )
    -- Template transclusion
    --     frame   -- object
    --     action  -- string, "flat" or "full" etc.
    -- Returns appropriate string
    Config.frame = frame
    return frontend( action,
                     frame.args,
                     frame:getParent().args,
                     frame:getTitle() )
end -- frontier()



local function full( arglist )
    -- Finalize invocation of template
    --     arglist  -- table, with parameters
    -- Returns appropriate string
    local r
    if arglist.Text1 then
        local slang = Config.slang
        local lone  = true
        local s, sep
        if not Config.scripting then
            Config.scripting = fit( Config.slang )
        end
        sep = follow( Config.scripting )
        if Config.scripting == Config.site then
            if slang == facility() then
                arglist.style = false
            elseif not arglist.style then
                arglist.style = "font-style:italic"
            end
            sep = follow( Config.site )
            if arglist.Text2 then
                arglist.Text2 = fault( "errInvalid",
                                       Config.site .. "+2=",
                                       true )
            end
        elseif not Config.low  and  not arglist.style then
            arglist.style = "font-style:normal"
        end
        if Config.state then
            slang = string.format( "%s-%s", slang, Config.state )
        end
        if Config.scripting then
            slang = string.format( "%s-%s", slang, Config.scripting )
        end
        r = Export.format( slang,
                           arglist.Text1,
                           arglist.style,
                           arglist.Audio,
                           arglist.class )
        if arglist.Text2 then
            local e = mw.html.create( "span" )
                             :addClass( Config.site )
                             :attr( "lang",
                                    string.format( "%s-%s",
                                                   Config.slang,
                                                   Config.site ) )
                             :css( { ["font-weight"] = "normal" } )
                             :wikitext( arglist.Text2 )
                             if Config.site == "Latn" then
                                 s = "italic"
                             else
                                 s = "normal"
                             end
                             e:css( { ["font-style"] = s } )
            r    = string.format( "%s %s%s",
                                  r,
                                  first( Config.site ),
                                  tostring( e ) )
            sep  = follow( Config.site )
            lone = false
        end
        if arglist.trans then
            local e
            for i = 1, #arglist.trans do
                e   = arglist.trans[ i ]
                r   = string.format( "%s%s %s",
                                     r,
                                     sep,
                                     friend( e.system, e.story ) )
                sep = follow( Config.site )
            end   -- for i
            lone = false
        end
        if not Config.low then
            if Config.scripting then
                s = false
                if arglist[ Config.scripting ]  and
                   not arglist.Text2 then
                    Fetch( "ISO15924" )
                    if Config.ISO15924 then
                        s = Config.ISO15924
                                          .scriptName( Config.scripting )
                    end
                end
                if not s  and  Config.service then
                    s = facet( Config.service )
                end
            elseif Config.service then
                s = Config.service
            else
                s = false
            end
            if s then
                if arglist.later then
                    r    = string.format( "%s (%s)", r, s )
                    lone = false
                else
                    r = string.format( "%s %s", s, r )
                end
            end
        end
        if arglist.IPA then
            local params = { [1] = arglist.IPA }
            s    = Frame():expandTemplate{ title = Config.ipa,
                                           args  = params }
            r    = string.format( "%s [%s]", r, s )
            sep  = follow()
            lone = false
        end
        if arglist.trsl then
            r = r .. foreigns( sep, arglist.trsl, lone )
        end
    elseif arglist.Text2 then
        r = fault( "errInvalid", "|1=|2=", true )
    else
        if Config.sole then
            r = Config.sole
        else
            r = Config.service
        end
    end
    return r
end -- full()



local function furnish( argsF, argsT )
    -- General entry point; basic argument consumption
    --     argsF  -- table, with #invoke parameters, or false
    --     argsT  -- table, with template parameters
    -- Returns appropriate string
    local parIgnore = { }
    local r = { }
    local s
    if argsF then
        if argsF.errHide ~= nil then
            Config.errHide = faculty( argsF.errHide )
        end
        Config.errCat     = argsF.errCat
        Config.errClasses = argsF.errClasses
        Config.errNS      = argsF.errNS
        if argsF.ELEMENT and argsF.ELEMENT:match( "^%a+$" ) then
            Config.scope = argsF.ELEMENT:lower()
        end
        if argsF.SUITABLE then
            local params = mw.text.split( argsF.SUITABLE, " ", true )
            for k, v in pairs( params ) do
                parIgnore[ v ] = true
            end -- for k, v
        end
    end
    if Config.scripting == "" then
        Config.scripting = false
    end
    if Config.scripting then
        table.insert( Config.params, Config.scripting )
    end
    if type( argsT ) == "table" then
        local n = table.maxn( Config.params )
        local script, unknown
        for k, v in pairs( argsT ) do
            v = flatten( v )
            s = type( k )
            if s == "number" then
                if Config.low then
                    k = k - 1
                end
                if k <= 2 then
                    if v then
                        if k == 0 then
                            k = false
                        else
                            if k == 1 then
                                r.Text1 = v
                                k       = false
                            elseif Config.scripting == Config.site then
                                k = "2"
                            else
                                r.Text2 = v
                                k       = false
                            end
                        end
                    else
                        if not Config.lenient then
                            -- LEGACY
                            k = string.format( "%s %s, |%d=",
                                               "Sprachvorlage:",
                                               factory( "errEmpty" ),
                                               k )
                            mw.addWarning( k )
                        end
                        k = false
                    end
                else
                    k = tostring( k )
                end
            elseif parIgnore[ k ] then
                k = false
            elseif k:match( "^%l%l%l?%-?" ) then
                s = k:match( "^(%l%l%l?)$" )  or
                    k:match( "^(%l%l%l?)%-%u%u$" )  or
                    k:match( "^(%l%l%l?)%-%u%l%l%l$" )
                if v then
                    script = k:match( "^%l%l%l?%-(%u%l%l%l)$" )
                else
                    k = false
                end
                if v   and   s   and
                   ( s ~= Config.slang  or
                     script ~= Config.scripting ) then
                    local legal = mw.language.isSupportedLanguage( s )
                    if not legal then
                        legal = ( s ~= fill( s ) )
                    end
                    if legal then
                        local state = k:match( "^%l%l%l?%-(%u%u)$" )
                        local m
                        if s == Config.slang then
                            m = Config.keyBase
                        else
                            m = Config.keyTranslate
                        end
                        if not script then
                            script = fit( s )
                            if script then
                                k = string.format( "%s-%s", s, script )
                            end
                        end
                        if not r.trsl then
                            r.trsl = { }
                        end
                        table.insert( r.trsl,
                                      { m      = m,
                                        n      = #r.trsl + 1,
                                        script = script,
                                        short  = s,
                                        slang  = k,
                                        state  = state,
                                        story  = v } )
                        k = false
                    end
                end
            elseif k:match( "^%u%u+%d*%.?%d*%-?%u*%d*$" ) then
                if familiar( k, Config.scripting )  or
                   familiar( k, Config.slang ) then
                    if v then
                        if not r.trans then
                            r.trans = { }
                        end
                        table.insert( r.trans,
                                      { system = k,
                                        story  = v } )
                    end
                    k = false
                end
            elseif k:match( "^%u%l%l%l$" ) then
                if k == Config.scripting then
                    if faculty( v ) then
                        r[ k ] = true
                    end
                else
                    if not r.trsl then
                        r.trsl = { }
                    end
                    table.insert( r.trsl,
                                  { m      = 100,
                                    n      = #r.trsl + 1,
                                    script = k,
                                    short  = Config.slang,
                                    slang  = string.format( "%s-%s",
                                                            Config.slang,
                                                            k ),
                                    story  = v } )
                end
                k = false
            end
            if k then
                for i = 1, n do
                    if Config.params[ i ] == k then
                        if v then
                            r[ k ] = v
                        end
                        k = false
                        break -- for i
                    end
                end -- for i
            end
            if k then
                if not unknown then
                    unknown = { }
                end
                table.insert( unknown, k )
            end
        end -- for k, v
        if r.demo  or  faculty( r.NoCat ) then
            Config.errCat  = 0
            Config.errHide = false
        end
        r.later = faculty( r.nachgestellt )
        if r.b and Config[ "OBSOLETING-bwd" ] then
            if r.de then
                r = fault( "errDoubled", "'de=' und 'b='", true )
            else
                r.de = r.b
            end
        end
        if r.w and Config[ "OBSOLETING-bwd" ] then
            if r.Text2 then
                r = fault( "errDoubled", "'2=' und 'w='", true )
            else
                r.Text2 = r.w
            end
        end
        if unknown then
            local e = mw.html.create( "code" )
                             :wikitext( table.concat( unknown, " " ) )
            r = fault( "errUnkown",
                       string.format( "'%s'",  tostring( e ) ),
                       true )
        end
    end
    if type( r ) == "table" then
        r = full( r )
    end
    return r
end -- furnish()



Export.flat = function ( argsF, argsT, auxilary )
    -- Invocation of basic language template
    --     argsF     -- table, with #invoke parameters, or false
    --     argsT     -- table, with template parameters
    --     auxilary  -- Multilingual library, or false
    -- Returns appropriate string
    local r
    if type( auxilary ) == "table" then
        Config.Multilingual = auxilary
    else
        r = Fetch( "Multilingual" )
    end
    if Config.Multilingual then
        local slang = argsT[ 1 ]
        local show  = argsT[ 2 ]
        if slang then
            slang = mw.text.trim( slang )
            if slang == "" then
                slang = false
            end
        end
        if show then
            show = flatten( show )
        end
        if slang and show then
            local q = Config.Multilingual.getLang( slang )
            if q and q.legal then
                Config.lenient   = faculty( argsT.lenient )
                Config.low       = true
                Config.slang     = q.base
                Config.state     = q.region
                Config.scripting = q.script
                r = furnish( argsF, argsT )
            else
                local e = mw.html.create( "span" )
                                 :attr( "lang", slang )
                                 :wikitext( show )
                local list = ( q and q.scream )
                local s
                if q and q.suggest then
                    local say = factory( "errSuggest" )
                    s = string.format( say, slang, q.suggest )
                else
                    s = slang
                end
                r = tostring( e ) ..
                    fault( "errInvalid",  s,  not list )
                if list then
                    r = string.format( "%s[[Category:%s]]", r, q.scream )
                end
            end
        else
            r = fault( "errMissing", false, true )
            if show then
                r = show .. r
            end
        end
    end
    return r
end -- Export.flat()



Export.fold = function ( argsF, argsT )
    -- Invocation of RTL template
    --     argsF  -- table, with #invoke parameters, or false
    --     argsT  -- table, with template parameters
    -- Returns appropriate string, or nil
    local params = { }
    local r, s, slang
    for k, v in pairs( argsT ) do
        if v then
            v = mw.text.trim( v )
            if v ~= "" then
                params[ k ] = v
            end
        end
    end -- for k, v
    if params[ 2 ] then
        s = params[ 2 ]:gsub( mw.ustring.char( 0x202A ), "" )
                       :gsub( mw.ustring.char( 0x202B ), "" )
                       :gsub( mw.ustring.char( 0x202C ), "" )
                       :gsub( mw.ustring.char( 0x202D ), "" )
                       :gsub( mw.ustring.char( 0x202E ), "" )
                       :gsub( mw.ustring.char( 0x2066 ), "" )
                       :gsub( mw.ustring.char( 0x2067 ), "" )
                       :gsub( mw.ustring.char( 0x2068 ), "" )
                       :gsub( mw.ustring.char( 0x2069 ), "" )
                       :gsub( mw.ustring.char( 8206 ), "&lrm;" )
                       :gsub( "&#0*8206;",             "&lrm;" )
                       :gsub( "&#x0*200[Ee];",         "&lrm;" )
                       :gsub( mw.ustring.char( 8207 ), "&rlm;" )
                       :gsub( "&#0*8207;",             "&rlm;" )
                       :gsub( "&#x0*200[Ff];",         "&rlm;" )
        if s:find( "&", 1, true ) then
            local shift = "^&rlm;%s*"
            while s:match( shift ) do
                s = s:gsub( shift, "" )
            end -- while
            shift = "%s*&lrm;$"
            while s:match( shift ) do
                s = s:gsub( shift, "" )
            end -- while
            if s == "" then
                s = false
            end
        end
    end
    if s   and
       s:sub( 1, 5 ) == "<bdo "   and
       s:find( "^<bdo [^<>]+><bdi [^<>]+>[^<>]+</bdi></bdo>$" ) then
        r = s
        s = false
    end
    if s then
        local bdi    = mw.html.create( "bdi" )
                              :attr( "dir", "rtl" )
                              :css( "unicode-bidi", "isolate" )
                              :wikitext( s )
        local bdo    = mw.html.create( "bdo" )
                              :attr( "dir", "ltr" )
        local slang  = params[ 1 ]
        local script = argsF.SCRIPTING
        local state  = argsF.STATE
        local selector
        family()
        if slang then
            if slang:find( "-", 3, true ) then
                local parts = mw.text.split( slang, "-", true )
                slang = parts[ 1 ]
                for i = 2, #parts do
                    if parts[ i ]:match( "^%u%u$" ) then
                        state = parts[ i ]
                    elseif parts[ i ]:match( "^%u%l%l%l$" ) then
                        script = parts[ i ]
                    end
                end -- for i
            end
            slang = slang:lower()
        else
            slang = "ar"
        end
        if script then
            first( script, bdo )
            features( bdi, script )
            selector = script
            if type( Config.classScript ) == "table" then
                selector = flag( selector, Config.classScript[ script ] )
            end
            s = string.format( "%s-%s", slang, script )
        else
            s = slang
        end
        if state then
            s = string.format( "%s-%s", s, state )
        end
        bdi:attr( "lang", s )
        selector = flag( selector, argsF.class )
        selector = flag( selector, params.class )
        if selector then
            bdi:addClass( selector )
        end
        if argsF.css then
            bdi:css( argsF.css )
        end
        if argsF.style then
            bdi:cssText( argsF.style )
        end
        if params.style then
            bdi:cssText( params.style )
        end
        bdo:node( bdi )
        r = tostring( bdo )
    end
    return r
end -- Export.fold()



Export.format = function ( alien, apply, appear, audio, alike )
    -- Markup foreign language text
    --     alien   -- string, with language code
    --     apply   -- string, with text
    --     appear  -- string, with additional CSS, or nil
    --     audio   -- string, with title of an audio file, or nil
    --     alike   -- string, with additional class(es), or nil
    -- Returns appropriate string with HTML tag
    local ltr = true
    local r, script, selector, slang, state
    family()
    if alien:find( "-", 3, true ) then
        local parts = mw.text.split( alien, "-", true )
        slang = parts[ 1 ]
        for i = 2, #parts do
            if parts[ i ]:match( "^%u%u$" ) then
                state = parts[ i ]
            elseif parts[ i ]:match( "^%u%l%l%l$" ) then
                script = parts[ i ]
            end
        end -- for i
    else
        slang = alien
    end
    slang = slang:lower()
    if not script then
        script = fit( slang )
    end
    if script then
        local rtl = Friend().rtl
        if type( rtl ) == "table" then
            ltr = not rtl[ script ]
        end
        if script ~= Config.site then
            selector = script
            if type( Config.classScript ) == "table" then
                selector = flag( selector, Config.classScript[ script ] )
            end
        end
    end
    selector = flag( selector, alike )
    if ltr then
        local scope = Config.scope or "span"
        local elem = mw.html.create( scope )
        local story = apply
        local set
        if script then
            set = string.format( "%s-%s", slang, script )
            features( elem, script )
        else
            set = slang
        end
        if state then
            set = string.format( "%s-%s", set, state )
        end
        elem:attr( "lang", set )
        if selector then
            elem:addClass( selector )
        end
        if appear then
            elem:cssText( appear )
        end
        if scope == "span" then
            story = story:gsub( "\n", " " )
        end
        elem:wikitext( story )
        r = tostring( elem )
        if script  and  script ~= Config.site then
            local lucky, x = pcall( require,
                                    "Module:Vorlage:lang/Zwiebelfisch" )
            r = first( script ) .. r
            if type( x ) == "table"  and
               type( x.finder ) == "function" then
                x = x.finder( apply, script )
                if type( x ) == "string" then
                    r = r .. x
                end
            end
        end
    else
        r = Export.fold( { SCRIPTING = script },
                         { [ 1 ] = slang,
                           [ 2 ] = apply,
                           class = selector,
                           style = appear } )
    end
    if mw.text.unstrip( apply ):sub( 1, 1 ) == "<" then
        local seek = "^(<([sd][paniv]+) [^>]+>)%1(.+)(</%2>)%4$"
        local s, start, story, stop
        start, s, story, stop = mw.text.unstrip( r ):match( seek )
        if story then
            r = Export.format( slang, story, appear, audio, alike )
        end
    end
    if audio and Config.tmplAudio then
        local params = { [ Config.tmplAudio.filepar ] = audio,
                         [ Config.tmplAudio.textpar ] = r }
        r = Frame():expandTemplate{ title = Config.tmplAudio.title,
                                    args  = params }
    end
    return r or ""
end -- Export.format()



Export.full = function ( argsF, argsT )
    -- Invocation of language name template
    --     argsF  -- table, with #invoke parameters, or false
    --     argsT  -- table, with template parameters
    -- Returns appropriate string
    if argsF then
        Config.lenient   = faculty( argsF.lenient )
        Config.long      = faculty( argsF.LONG )
        Config.scripting = argsF.SCRIPTING
        Config.service   = argsF.SERVICE
        Config.slang     = argsF.CODE
        Config.sole      = argsF.SOLE
        if argsF["OBSOLETING-bwd"] then
            table.insert( Config.params, "b" )
            table.insert( Config.params, "d" )
            table.insert( Config.params, "w" )
        end
    end
    Config.low = false
    return furnish( argsF, argsT )
end -- Export.full()



Failsafe.failsafe = function ( atleast )
    -- Retrieve versioning and check for compliance
    -- Precondition:
    --     atleast  -- string, with required version or "wikidata" or "~"
    --                 or false
    -- Postcondition:
    --     Returns  string  -- with queried version, also if problem
    --              false   -- if appropriate
    local last  = ( atleast == "~" )
    local since = atleast
    local r
    if last  or  since == "wikidata" then
        local item = Failsafe.item
        since = false
        if type( item ) == "number"  and  item > 0 then
            local entity = mw.wikibase.getEntity( string.format( "Q%d",
                                                                 item ) )
            if type( entity ) == "table" then
                local vsn = entity:formatPropertyValues( "P348" )
                if type( vsn ) == "table"  and
                   type( vsn.value ) == "string"  and
                   vsn.value ~= "" then
                    if last  and  vsn.value == Failsafe.serial then
                        r = false
                    else
                        r = vsn.value
                    end
                end
            end
        end
    end
    if type( r ) == "nil" then
        if not since  or  since <= Failsafe.serial then
            r = Failsafe.serial
        else
            r = false
        end
    end
    return r
end -- Failsafe.failsafe()



-- Export
local p = { }


p.test = function ( action, argsF, argsT )
    --     action  -- string, "flat" or "full" etc.
    --     argsF   -- table, with #invoke parameters, or false
    --     argsT   -- table, with template parameters
    return frontend( action, argsF, argsT )
end -- p.test()


p.flat = function ( frame )
    return frontier( frame, "flat" )
end -- p.flat()


p.fold = function ( frame )
    return frontier( frame, "fold" )  or   ""
end -- p.fold()


p.full = function ( frame )
    return frontier( frame, "full" )
end -- p.full()



p.failsafe = function ( frame )
    -- Versioning interface
    local s = type( frame )
    local since
    if s == "table" then
        since = frame.args[ 1 ]
    elseif s == "string" then
        since = frame
    end
    if since then
        since = mw.text.trim( since )
        if since == "" then
            since = false
        end
    end
    return Failsafe.failsafe( since )  or  ""
end -- p.failsafe



p.lang = function ()
    return Export
end -- p.lang()

return p
牛油果和什么榨汁好喝 活化是什么意思 贡中毒有什么症状 1223是什么星座 料酒是什么酒
化验血能查出什么项目 排酸对身体有什么好处 六月初七是什么星座 不什么下什么的成语 离职什么意思
支元体阳性是什么意思 工口是什么意思 朱雀玄武是什么意思 焘是什么意思 上海松江有什么好玩的地方
没有鱼鳞的鱼是什么鱼 办理住院手续需要带什么证件 一毛不拔是什么动物 牙疼吃什么药最好最有效 小鸟吃什么食物
单独是什么意思hcv9jop3ns6r.cn 处女座幸运颜色是什么hcv8jop7ns8r.cn 2001年属什么生肖cj623037.com 终结者是什么意思hcv9jop4ns8r.cn 女生两个月没来月经是什么原因bjcbxg.com
大小脸是什么原因造成的hcv9jop8ns0r.cn 生殖疱疹用什么药效果好hcv9jop0ns0r.cn 淋巴结肿大是什么引起的hcv9jop6ns3r.cn 脂溢性皮炎头皮用什么洗发水hcv8jop3ns3r.cn 婚检男性检查什么项目hcv8jop5ns1r.cn
为什么男人喜欢女人的胸hcv8jop5ns0r.cn 一带一路指的是什么hcv8jop1ns2r.cn 人均可支配收入是什么意思hcv8jop0ns1r.cn 小孩舌头白是什么原因hcv9jop0ns3r.cn 九眼天珠适合什么人戴hcv8jop9ns0r.cn
宜祭祀是什么意思hcv8jop2ns9r.cn petct是什么检查hcv9jop0ns0r.cn 空调数显是什么意思hcv7jop7ns0r.cn sinoer是什么牌子hcv8jop7ns9r.cn 把头是什么意思hcv8jop1ns0r.cn
百度