Module:Citation/CS1: திருத்தங்களுக்கு இடையிலான வேறுபாடு

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
சி update
சி Trappist the monkஆல் செய்யப்பட்ட கடைசித் தொகுப்புக்கு முன்நிலையாக்கப்பட்டது
வரிசை 1:
 
 
local cs1 ={};
வரி 174 ⟶ 173:
 
Split a url into a scheme, authority indicator, and domain.
 
First remove Fully Qualified Domain Name terminator (a dot following tld) (if any) and any path(/), query(?) or fragment(#).
 
If protocol relative url, return nil scheme and domain else return nil for both scheme and domain.
 
வரி 189 ⟶ 185:
local scheme, authority, domain;
url_str = url_str:gsub ('([%a%d])%.?[/%?#].*$', '%1'); -- strip FQDN terminator and path(/), query(?), fragment (#) (the capture prevents false replacement of '//')
 
if url_str:match ('^//%S*') then -- if there is what appears to be a protocol relative url
வரி 246 ⟶ 242:
if not link_param_ok (link) then -- check |<param>-link= markup
orig = lorig; -- identify the failing link parameter
elseif title:findnot link_param_ok ('%[%['title) then -- check |<title>-link= for wikilink markup
orig = torig; -- identify the failing link parameter
end
வரி 462 ⟶ 458:
script_value = script_value:gsub ('^%l%l%s*:%s*', ''); -- strip prefix from script
-- is prefix one of these language codes?
if in_array (lang, {'am', 'ar', 'be', 'bg', 'bs', 'dv', 'el', 'fa', 'he', 'hy', 'ja', 'ka', 'ko', 'ku', 'mk', 'ml', 'ps', 'ru', 'sd', 'sr', 'th', 'uk', 'ug', 'yi', 'zh'}) then
add_prop_cat ('script_with_name', {name, lang})
else
வரி 1,084 ⟶ 1,080:
--[[--------------------------< G E T _ I S O 6 3 9 _ C O D E >------------------------------------------------
 
Validates language names provided in |language= parameter if not an ISO639-1 code. Handles the special case that is Norwegian where
ISO639-1 code 'no' is mapped to language name 'Norwegian Bokmål' by Extention:CLDR.
 
Returns the language name and associated ISO639-1 code. Because case of the source may be incorrect or different from the case that Wikimedia
வரி 1,099 ⟶ 1,096:
]]
 
local function get_iso639_code (lang, this_wiki_code)
if 'norwegian' == lang:lower() then -- special case related to Wikimedia remap of code 'no' at Extension:CLDR
local languages = mw.language.fetchLanguageNames(this_wiki_code, 'all') -- get a list of language names known to Wikimedia
return 'Norwegian', 'no'; -- Make sure rendered version is properly capitalized
end
local languages = mw.language.fetchLanguageNames(this_wiki_code'en', 'all') -- get a list of language names known to Wikimedia
-- ('all' is required for North Ndebele, South Ndebele, and Ojibwa)
local langlc = mw.ustring.lower(lang); -- lower case version for comparisons
வரி 1,118 ⟶ 1,119:
 
Get language name from ISO639-1 code value provided. If a code is valid use the returned name; if not, then use the value that was provided with the language parameter.
 
There is an exception. There are three ISO639-1 codes for Norewegian language variants. There are two official variants: Norwegian Bokmål (code 'nb') and
Norwegian Nynorsk (code 'nn'). The third, code 'no', is defined by ISO639-1 as 'Norwegian' though in Norway this is pretty much meaningless. However, it appears
that on enwiki, editors are for the most part unaware of the nb and nn variants (compare page counts for these variants at Category:Articles with non-English-language external links.
 
Because Norwegian Bokmål is the most common language variant, Media wiki has been modified to return Norwegian Bokmål for ISO639-1 code 'no'. Here we undo that and
return 'Norwegian' when editors use |language=no. We presume that editors don't know about the variants or can't descriminate between them.
 
See Help talk:Citation Style_1#An ISO 639-1 language name test
 
When |language= contains a valid ISO639-1 code, the page is assigned to the category for that code: Category:Norwegian-language sources (no) if
the page is a mainspace page and the ISO639-1 code is not the local wiki's language codeen'. Similarly, if the parameter is |language=Norwegian, it will be categorized in the same way.
it will be categorized in the same way.
 
This function supports multiple languages in the form |language=nb, French, th where the language names or codes are separated from each other by commas.
வரி 1,132 ⟶ 1,141:
local language_list = {}; -- table of language names to be rendered
local names_table = {}; -- table made from the value assigned to |language=
 
local this_wiki = mw.getContentLanguage(); -- get a language object for this wiki
local this_wiki_code = this_wiki:getCode() -- get this wiki's language code
local this_wiki_name = mw.language.fetchLanguageName(this_wiki_code, this_wiki_code); -- get this wiki's language name
 
names_table = mw.text.split (lang, '%s*,%s*'); -- names should be a comma separated list
வரி 1,145 ⟶ 1,150:
end
if 2 == lang:len() then -- ISO639-1 language code are 2 characters (fetchLanguageName also supports 3 character codes)
name = mw.language.fetchLanguageName( lang:lower(), this_wiki_code"en" ); -- get ISO 639-1 language name if Language is a proper code
end
வரி 1,151 ⟶ 1,156:
code = lang:lower(); -- save it
else
name, code = get_iso639_code (lang, this_wiki_code); -- attempt to get code from name (assign name here so that we are sure of proper capitalization)
end
if is_set (code) then
if this_wiki_code'no' ~== code then name = 'Norwegian' end; -- whenoverride thewikimedia languagewhen code is not the same as this wiki's languageno'
add_prop_catif ('foreign_lang_sourceen', {name,~= code}) then -- categorizeEnglish not the itlanguage
add_prop_cat ('foreign_lang_source', {name, code})
end
else
வரி 1,173 ⟶ 1,179:
name = table.concat (language_list, ', ') -- and concatenate with '<comma><space>' separators
end
if this_wiki_name'English' == name then
return ''; -- if one language and that language is this wiki'sEnglish return an empty string (no annotation)
end
return (" " .. wrap_msg ('language', name)); -- otherwise wrap with '(in ...)'
வரி 1,364 ⟶ 1,370:
 
This function sets the vancouver error when a reqired comma is missing and when there is a space between an author's initials.
 
TODO: check for names like Coon V JS (Coon JS 5th at PMID 25205766, John S. Coon V at doi:10.1093/humupd/dmu048)?
 
]]
வரி 2,341 ⟶ 2,345:
end
 
if not is_set(URL) then --and
if in_array(config.CitationClass, {"web","podcast", "mailinglist"}) then -- testTest if cite web or cite podcast |url= is missing or empty
table.insert( z.message_tail, { set_error( 'cite_web_url', {}, true ) } );
end
-- testTest if accessdate is given without giving a URL
if is_set(AccessDate) and not is_set(ChapterURL)then -- ChapterURL may be set when the others are not set; TODO: move this to a separate test?
table.insert( z.message_tail, { set_error( 'accessdate_missing_url', {}, true ) } );
வரி 2,410 ⟶ 2,414:
Chapter = format_chapter_title (ScriptChapter, Chapter, TransChapter, ChapterURL, ChapterURLorigin, no_quotes); -- Contribution is also in Chapter
if is_set (Chapter) then
Chapter = Chapter .. ChapterFormat ;
if 'map' == config.CitationClass and is_set (TitleType) then
Chapter = Chapter .. ' ' .. TitleType; -- map annotation here; not after title
end
Chapter = Chapter .. ChapterFormat .. sepc .. ' ';
elseif is_set (ChapterFormat) then -- |chapter= not set but |chapter-format= is so ...
Chapter = ChapterFormat .. sepc .. ' '; -- ... ChapterFormat has error message, we want to see it
வரி 2,885 ⟶ 2,888:
end
if is_set(options.id) then -- here we wrap the rendered citation in <cite ...>...</cite> tags
text = substitute (cfg.presentation['<cite- id="'], {.. mw.uri.anchorEncode(options.id), ..'" class="' .. mw.text.nowiki(options.class), text}); --.. when'">' |ref=.. istext set.. "</cite>";
else
text = substitute (cfg.presentation['<cite class="'], {.. mw.text.nowiki(options.class), text}); --.. all'">' other.. casestext .. "</cite>";
end
 
local empty_span = '<span style="display:none;">&nbsp;</span>';
text = text .. substitute (cfg.presentation['ocins'], {OCinSoutput}); -- append metadata to the citation
-- Note: Using display: none on the COinS span breaks some clients.
local OCinS = '<span title="' .. OCinSoutput .. '" class="Z3988">' .. empty_span .. '</span>';
text = text .. OCinS;
if #z.message_tail ~= 0 then
"https://tamilar.wiki/w/Module:Citation/CS1" இலிருந்து மீள்விக்கப்பட்டது