Modul:Lang: Perbezaan antara semakan
Kandungan dihapus Kandungan ditambah
k pengemasan sintaks (separa) |
pengemasan sintaks (separa) |
||
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, '
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 679:
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:
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
|