Modul:Partai politik: Perbedaan antara revisi

192 bita ditambahkan ,  2 tahun yang lalu
tidak ada ringkasan suntingan
Tidak ada ringkasan suntingan
Tidak ada ringkasan suntingan
Baris 45: Baris 45:
  local party = stripToNil(args[1])
  local party = stripToNil(args[1])
local out_type = stripToNil(args[2])
local out_type = stripToNil(args[2])
-- if out_type == 'colour' then
-- out_type = 'color'
-- end
if out_type == 'colour' then
if out_type == 'colour' then
out_type = 'color'
out_type = 'warna'
end
end
local index = getFirstLetter(party)
local index = getFirstLetter(party)
Baris 73: Baris 76:
-- * No shortname/abbrev - return first non-blank of abbrev->shortname->input
-- * No shortname/abbrev - return first non-blank of abbrev->shortname->input
if not party_info then
if not party_info then
if out_type == 'color' then
-- if out_type == 'color' then
if out_type == 'warna' then
return args.error or default_color
return args.error or default_color
else
else
Baris 81: Baris 85:
local return_value = party_info[out_type]
local return_value = party_info[out_type]
if return_value == "" then
if return_value == "" then
if out_type == 'color' then
-- if out_type == 'color' then
if out_type == 'warna' then
return args.error or create_error("Value not in template. Please request that it be added.")
return args.error or create_error("Value not in template. Please request that it be added.")
elseif out_type == 'abbrev' then
elseif out_type == 'abbrev' then
Baris 100: Baris 105:
end
end


if out_type == 'color' and string.find(return_value, '#') then
-- if out_type == 'color' and string.find(return_value, '#') then
if out_type == 'warna' and string.find(return_value, '#') then
return_value = string.gsub(return_value, '#', '#')
return_value = string.gsub(return_value, '#', '#')
end
end