ಮಾಡ್ಯೂಲ್:Footnotes: ಪರಿಷ್ಕರಣೆಗಳ ನಡುವಿನ ವ್ಯತ್ಯಾಸ
Content deleted Content added
ಚು ೪ revisions imported from en:Module:Footnotes |
ಚು copy from en.wiki; +i18n support; |
||
೧೯ ನೇ ಸಾಲು:
}
};
-- this table holds local language digits. core() will use local language year when rendering but will use Western digits [0-9] in the
-- CITEREF link so that short refs using this Module properly link to anchors produced by cs1|2 templates and Module:Citation/CS1
local local_digits = {['೦'] = '0', ['೧'] = '1', ['೨'] = '2', ['೩'] = '3', ['೪'] = '4', ['೫'] = '5', ['೬'] = '6', ['೭'] = '7', ['೮'] = '8', ['೯'] = '9'};
function trim( str )
Line ೨೬ ⟶ ೩೧:
return str:match( "^%s*(.-)%s*$");
end
local function is_year (param)
return mw.ustring.match (param, '^%d%d%d%d?%l?$') or param:match ('^n%.d%.%l?$') or param:match ('^nd%l?$') or param:match ('^c%. %d%d%d%d?%l?$') or param:match ('^%d%d%d%d–%d%d%d%d%l?$');
end
function core( args )
local result;
if args.P5 ~= "" then
if is_year (args.P5) then
result = table.concat ({args.P1, ' et al. ', args.bracket_year_left, args.P5, args.bracket_year_right});
args.P5 = mw.ustring.gsub (args.P5, '%d', local_digits); -- convert local language digits to [0-9] for CITEREF link
else
args.P5 = ''; -- when P5 not a year don't include in anchor
result = table.concat ({args.P1, ' et al.'}); -- and don't render it
end
elseif args.P4 ~= "" then
if is_year (args.P4) then
result = args.P1 .. ', ' .. args.P2 .. ' & ' .. args.P3 .. ' ' .. ▼
result = table.concat ({args.
args.P4 = mw.ustring.gsub (args.P4, '%d', local_digits); -- convert local language digits to [0-9] for CITEREF link
else
result = table.concat ({args.P1, ' et al.'}); -- four names
end
elseif args.P3 ~= "" then
if is_year (args.P3) then
result = table.concat ({args.
args.P3 = mw.ustring.gsub (args.P3, '%d', local_digits); -- convert local language digits to [0-9] for CITEREF link
else
▲ result = table.concat ({args.P1
end
elseif args.P2 ~= "" then
if is_year (args.P2) then
result = table.concat ({args.P1
args.P2 = mw.ustring.gsub (args.P2, '%d', local_digits); -- convert local language digits to [0-9] for CITEREF link
else
result = table.concat ({args.P1
end
else
result =
end
|