Modul:Lang: Perbezaan antara semakan

Kandungan dihapus Kandungan ditambah
Azuru79 (bincang | sumb.)
kTiada ringkasan suntingan
Polar (bincang | sumb.)
Tiada ringkasan suntingan
Baris 112:
local count = 0
for _, arg in pairs {'italic', 'italics', 'i', 'italik'} do
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, 'hanyaonly satuone dariof |italic=, |italics=, or |i= atau |italik=can bolehbe diperincikanspecified';
end
Baris 244:
 
if not is_set (source) then
return nil, nil, nil, nil, nil, 'tegmissing bahasalanguage hilangtag';
end
 
Baris 299:
 
if not code then
return nil, nil, nil, nil, nil, table.concat ({'tegunrecognized bahasalanguage tidak diiktiraftag: ', source}); -- don't know what we got but it is malformed
end
 
Baris 305:
if not (lang_data.override[code] or lang_name_table.lang[code]) then
return nil, nil, nil, nil, nil, table.concat ({'tegunrecognized bahasalanguage tidak diiktirafcode: ', code}); -- invalid language code, don't know about the others (don't care?)
end
if synonym_table[code] then -- if 639-2/639-2T code has a 639-1 synonym
table.insert (maint_cats, table.concat ({'KodLang lang danand lang-xx digalakkancode promoted keto ISO 639-1|', code}));
table.insert (maint_msgs, table.concat ({'kodcode: ', code, ' digalakkanpromoted keto kodcode: ', synonym_table[code]}));
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, 'tegredundant aksarascript lewahtag'; -- both code with script and |script= not allowed
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 ({'aksaraunrecognized tidak diiktirafscript: ', script, ' untukfor kodcode: ', code}); -- language code ok, invalid script, don't know about the others (don't care?)
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 ({'aksarascript: ', script, ' tidaknot disokongsupported untukfor kodcode: ', code}); -- language code ok, script is suppressed for this code
end
end
Baris 336:
if is_set (region) then
if is_set (args_region) then
return code, nil, nil, nil, nil, 'tegredundant rantauregion lewahtag'; -- both code with region and |region= not allowed
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 ({'rantauunrecognized tidak diiktirafregion: ', region, ' untukfor kodcode: ', code});
end
end
Baris 351:
if is_set (variant) then
if is_set (args_variant) then
return code, nil, nil, nil, nil, 'tegredundant varianvariant lewahtag'; -- both code with variant and |variant= not allowed
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 ({'varianunrecognized tidak diiktirafvariant: ', variant});
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 ({'varianunrecognized tidak diiktirafvariant: ', variant, ' untuk pasanganfor aksaracode-script kodpair: ', code, '-', script});
end
else
if not in_array (code, lang_name_table.variant[variant]['awalanprefixes']) then
return code, script, region, nil, nil, table.concat ({'varianunrecognized tidak diiktirafvariant: ', variant, ' untukfor kodcode: ', code});
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 ({'tegunrecognized persendirianprivate tidak diiktiraftag: ', private});
end
end
Baris 396:
category = 'transl';
else
category = 'lang danand lang-xx'
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:Ralat templat ', category, ' template errors|bantuanhelp]])'}));
table.insert (out, '</span>');
if (0 == namespace) and not args.nocat then -- only categorize in article space
table.insert (out, table.concat ({'[[Kategori:Ralat templat ', category, ' template errors]]'}));
end
 
Baris 512:
 
if is_set (language) then
table.insert (html, table.concat ({style_added, ' title=\"', language})); -- start of the title text
if language:find ('Bahasa-bahasalanguages') then
table.insert (html, table.concat ({' Tekscollective kolektif ', language, 'text\"'})); -- for collective languages
else
table.insert (html, table.concat ({' Teks bahasa ', language, 'text\"'})); -- for individual languages
end
table.insert (html, '>'); -- close the opening html tag
Baris 537:
 
For individual language, <language>, returns:
[[CategoryKategori:Articles containing <language>-language text]]
 
for English:
Baris 557:
end
if language_name:find ('Bahasa-bahasalanguages') then
return table.concat ({'[[Category:RencanaArticles denganwith tekstext kolektiffrom dari bahasathe ', language_name, ' collective]]'});
end
table.insert (cat, '[[Category:RencanaArticles yang mengandungi teks bahasacontaining ');
if 'msen' == code then
table.insert (cat, 'secaraexplicitly jelascited menyebut Bahasa MelayuEnglish');
elseif 'art' == code then
table.insert (cat, 'yang dibinaconstructed')
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 ('Bahasa-bahasalanguages') then -- collective language names (plural 'languages' is part of the name)
table.insert (tout, 'bahasa -language') -- skip this text (individual and macro languages only)
end
table.insert (tout, 'Transliterasi transliteration'); -- finish the tool tip
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 ('Bahasa-bahasalanguages') then -- collective language names (plural 'languages' is part of the name)
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 ('tiadano tekstext', args, template);
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 ('tekstext mempunyaihas penandamalformed cacatmarkup', args, template);
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 ('tekstext mempunyaihas penandaitalic italikmarkup', args, template);
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 ('Bahasa-bahasalanguages') then
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 ('Bahasa 'language_name .. language_name, 'bahasa language' .., language_name)); -- language name with 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 ({'PerumianRomanization untukof ', translit_script_name})); -- make a title object
if translit_title.exists and ('no' ~= args.link) then
table.insert (out, make_wikilink ('PerumianRomanization untukof ' .. translit_script_name or language_name, 'translit. ' .. language_name)); -- make a wikilink if there is an article to link to
else
table.insert (out, '<abbr title="transliterasitransliteration">translit.</abbr>'); -- else define the abbreviation
end
table.insert (out, '&nbsp;</small>'); -- close the small tag
Baris 1,122 ⟶ 1,127:
table.insert (out, '<small>');
if 'no' == args.link then
table.insert (out, '<abbr title="terjemahan literal translation">lit.</abbr>');
else
table.insert (out, make_wikilink ('TerjemahanLiteral literaltranslation', 'lit.'));
end
table.insert (out, "&nbsp;</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 ('Bahasa-bahasalanguages') then
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 ('Bahasa 'language_name .. language_name, 'bahasa language' .., language_name); -- language name with wikilink
end
end