Module:Citation/CS1: திருத்தங்களுக்கு இடையிலான வேறுபாடு
உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
சி update |
சி Trappist the monkஆல் செய்யப்பட்ட கடைசித் தொகுப்புக்கு முன்நிலையாக்கப்பட்டது |
||
வரிசை 1:
local cs1 ={};
வரி 174 ⟶ 173:
Split a url into a scheme, authority indicator, and domain.
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])%.?
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
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
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
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(
-- ('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
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=
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(),
end
வரி 1,151 ⟶ 1,156:
code = lang:lower(); -- save it
else
name, code = get_iso639_code (lang
end
if is_set (code) then
if
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
return ''; -- if one language and that language is
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.
]]
வரி 2,341 ⟶ 2,345:
end
if not is_set(URL) then --and
if in_array(config.CitationClass, {"web","podcast", "mailinglist"}) then --
table.insert( z.message_tail, { set_error( 'cite_web_url', {}, true ) } );
end
--
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
if 'map' == config.CitationClass and is_set (TitleType) then
Chapter = Chapter .. ' ' .. TitleType;
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
text =
else
text =
end
local empty_span = '<span style="display:none;"> </span>';
-- 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
| |||