Modul:Lang: Perbezaan antara semakan
Kandungan dihapus Kandungan ditambah
kTiada ringkasan suntingan |
Tiada ringkasan suntingan |
||
Baris 112:
local count = 0
for _, arg in pairs {'italic', 'italics', 'i
if args[arg] then
count = count + 1
Baris 119:
if count > 1 then -- return nil and an error message if more than one is set
return nil, '
end
Baris 244:
if not is_set (source) then
return nil, nil, nil, nil, nil, '
end
Baris 299:
if not code then
return nil, nil, nil, nil, nil, table.concat ({'
end
Baris 305:
if not (lang_data.override[code] or lang_name_table.lang[code]) then
return nil, nil, nil, nil, nil, table.concat ({'
end
if synonym_table[code] then -- if 639-2/639-2T code has a 639-1 synonym
table.insert (maint_cats, table.concat ({'
table.insert (maint_msgs, table.concat ({'
code = synonym_table[code]; -- use the synonym
end
Baris 316:
if is_set (script) then
if is_set (args_script) then
return code, nil, nil, nil, nil, '
end
else
Baris 325:
script = script:lower(); -- ensure that we use and return lower case version of this
if not lang_name_table.script[script] then
return code, nil, nil, nil, nil, table.concat ({'
end
end
if lang_name_table.suppressed[script] then -- ensure that code-script does not use a suppressed script
if in_array (code, lang_name_table.suppressed[script]) then
return code, nil, nil, nil, nil, table.concat ({'
end
end
Baris 336:
if is_set (region) then
if is_set (args_region) then
return code, nil, nil, nil, nil, '
end
else
Baris 345:
region = region:lower(); -- ensure that we use and return lower case version of this
if not lang_name_table.region[region] then
return code, script, nil, nil, nil, table.concat ({'
end
end
Baris 351:
if is_set (variant) then
if is_set (args_variant) then
return code, nil, nil, nil, nil, '
end
else
Baris 360:
variant = variant:lower(); -- ensure that we use and return lower case version of this
if not lang_name_table.variant[variant] then -- make sure variant is valid
return code, script, region, nil, nil, table.concat ({'
end -- does this duplicate/replace tests in lang() and lang_xx()?
if is_set (script) then -- if script set it must be part of the 'prefix'
if not in_array (table.concat ({code, '-', script}), lang_name_table.variant[variant]['prefixes']) then
return code, script, region, nil, nil, table.concat ({'
end
else
if not in_array (code, lang_name_table.variant[variant]['
return code, script, region, nil, nil, table.concat ({'
end
end
Baris 376:
private = private:lower(); -- ensure that we use and return lower case version of this
if not lang_data.override[table.concat ({code, '-x-', private})] then -- make sure private tag is valid; note that index
return code, script, region, nil, nil, table.concat ({'
end
end
Baris 396:
category = 'transl';
else
category = 'lang
end
Baris 402:
table.insert (out, table.concat ({'<span style=\"font-size:100%; font-style:normal;\" class=\"error\">error: {{', template, '}}: '}));
table.insert (out, msg);
table.insert (out, table.concat ({' ([[:Kategori:
table.insert (out, '</span>');
if (0 == namespace) and not args.nocat then -- only categorize in article space
table.insert (out, table.concat ({'[[Kategori:
end
Baris 512:
if is_set (language) then
table.insert (html, table.concat ({style_added, ' title=\"', language}));
if language:find ('
table.insert (html,
else
table.insert (html,
end
table.insert (html, '>'); -- close the opening html tag
Baris 537:
For individual language, <language>, returns:
[[
for English:
Baris 557:
end
if language_name:find ('
return table.concat ({'[[Category:
end
table.insert (cat, '[[Category:
if '
table.insert (cat, '
elseif 'art' == code then
table.insert (cat, '
else
table.insert (cat, language_name
end
table.insert (cat, '-language text]]');
return table.concat (cat);
Baris 613 ⟶ 615:
if not is_set (std) and not is_set (tscript) then -- when neither standard nor script specified
table.insert (tout, 'Transliterasi '); -- finish the tool tip▼
if not language_name:find ('Bahasa-bahasa') then -- collective language names (plural 'languages' is part of the name)▼
table.insert (tout, 'bahasa ') -- skip this text (individual and macro languages only)▼
end▼
table.insert (tout, language_name); -- write a generic tool tip
▲ if not language_name:find ('
▲ end
elseif is_set (std) and is_set (tscript) then -- when both are specified
if title_table[std] then -- and if standard is legitimate
Baris 646 ⟶ 648:
table.insert (tout, table.concat ({language_name, '-script transliteration'})); -- write a script tool tip
elseif is_set (code) then
if not language_name:find ('
table.insert (tout, '-language') -- skip this text (individual and macro languages only)
end
Baris 679 ⟶ 681:
local function validate_text (template, args)
if not is_set (args.text) then
return make_error_msg ('
end
if args.text:find ("%f[\']\'\'\'\'%f[^\']") or args.text:find ("\'\'\'\'\'[\']+") then -- because we're looking, look for 4 appostrophes or 6+ appostrophes
return make_error_msg ('
end
Baris 690 ⟶ 692:
if ('unset' ~= style) and ('invert' ~=style) then
if args.text:find ("%f[\']\'\'%f[^\']") or args.text:find ("%f[\']\'\'\'\'\'%f[^\']") then -- italic but not bold, or bold italic
return make_error_msg ('
end
end
Baris 824 ⟶ 826:
local msg; -- for error messages
local tag = 'span'; -- initial value for make_text_html()
local template = args.template or 'lang';
if args[1] and args.code then
Baris 1,074 ⟶ 1,077:
table.insert (out, language_name); -- language name without wikilink
else
if language_name:find ('
table.insert (out, make_wikilink (language_name)); -- collective language name uses simple wikilink
elseif lang_data.article_name[code] then
table.insert (out, make_wikilink (lang_data.article_name[code][1], language_name)); -- language name with wikilink from override data
else
table.insert (out, make_wikilink (
end
end
Baris 1,100 ⟶ 1,105:
translit_script_name = language_name; -- fall back on language name
end
translit_title = mw.title.makeTitle (0, table.concat ({'
if translit_title.exists and ('no' ~= args.link) then
table.insert (out, make_wikilink ('
else
table.insert (out, '<abbr title="
end
table.insert (out, ' </small>'); -- close the small tag
Baris 1,122 ⟶ 1,127:
table.insert (out, '<small>');
if 'no' == args.link then
table.insert (out, '<abbr title="
else
table.insert (out, make_wikilink ('
end
table.insert (out, " </small>");
Baris 1,217 ⟶ 1,222:
language_name = language_name:gsub ('%s+%b()', ''); -- remove IANA parenthetical disambiguators or qualifiers from names that have them
--error(lang_data.article_name[code][1])
if link then -- when |link=yes, wikilink the language name
if language_name:find ('
return make_wikilink (language_name); -- collective language name uses simple wikilink
elseif lang_data.article_name[code] then
return make_wikilink (lang_data.article_name[code][1], language_name); -- language name with wikilink from override data
else
return make_wikilink (
end
end
|