imported>Dabao qian
无编辑摘要
imported>Dabao qian
撤销Dabao qian讨论)的版本51086248
第22行: 第22行:
local maint_msgs = {}; -- and their messages go here
local maint_msgs = {}; -- and their messages go here


local function page_exists (title)
    -- This function implements #ifexist
    local noError, titleObject = pcall (mw.title.new, title)
    if not noError then
        return false
    else
        if titleObject then
            return titleObject.exists
        else
            return false
        end
    end
end


--[[--------------------------< I S _ S E T >------------------------------------------------------------------
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
第559行: 第546行:
if (0 ~= namespace) or nocat then -- only categorize in article space
if (0 ~= namespace) or nocat then -- only categorize in article space
return ''; -- return empty string for concatenation
return ''; -- return empty string for concatenation
end
if language_name:find ('languages') then
return table.concat ({'[[Category:Articles with text from the ', language_name, ' collective]]'});
end
end
第567行: 第558行:
elseif 'art' == code then
elseif 'art' == code then
table.insert (cat, '構造語言')
table.insert (cat, '構造語言')
elseif (page_exists ('Category:含有' .. language_name .. '的條目') ) then
else
table.insert (cat, language_name);
table.insert (cat, language_name);
else
table.insert (cat, '非中文內容');
end
end