ماجۊل:Webarchive/data

Wikipedia جي

توضیحات این پودمان می‌تواند در ماجۊل:Webarchive/data/توضیحات قرار گیرد.

--[[--------------------------< C O N F I G U R A T I O N >----------------------------------------------------

global configuration settings

]]

local config = {
	maxurls = 10,																-- Max number of URLs allowed. 
	tname = 'Webarchive',														-- name of calling template. Change if template rename.
	verifydates = true,															-- See documentation. Set false to disable.
	}


--[[--------------------------< U N C A T E G O R I Z E D _ N A M E S P A C E S >------------------------------

List of namespaces that should not be included in citation error categories.

Note: Namespace names should use underscores instead of spaces.

]]

local uncategorized_namespaces = {												-- same list as specified at [[Module:Citation/CS1/Configuration]]
	['کارگير']=true, ['گب']=true, ['کارگيرˇ_گب']=true, ['بحث_ویکی‌پدیا']=true, ['فاىلˇ_گب']=true,
	['قالبˇ_گب']=true, ['رانما_گب']=true, ['جرگه_گب']=true, ['بحث_درگاه']=true,
	['بحث_کتاب']=true, ['بحث_پیش‌نویس']=true, ['بحث ابزار']=true, ['ماجۊلˇ_گب']=true,
	['مدياويکي_گب']=true,
	}

local uncategorized_subpages = {'/[Ss]andbox', '/[Tt]estcases'};				-- list of Lua patterns found in page names of pages we should not categorize

local excepted_pages = {														-- these pages will be categorized if set true; set to nil to disable
	['بحث پودمان:Webarchive/testcases'] = true,								-- test cases pages used during development
	['Template:Webarchive/testcases/Production'] = true,
	}


--[[--------------------------< C A T E G O R I E S >----------------------------------------------------------

this is a table of all categories supported by Module:Webarchive

]]

local categories = {
	archiveis = 'رده:پیوندهای آرشیوایز الگوی بایگانی اینترنت',
	error = 'رده:خطاهای الگوی بایگانی اینترنت',
	other = 'رده:سایر بایگانی‌های الگوی بایگانی اینترنت',
	unknown = 'رده:بایگانی‌های نامعلوم الگوی بایگانی اینترنت',
	warning = 'رده:هشدارهای الگوی بایگانی اینترنت',
	wayback = 'رده:پیوندهای وی‌بک الگوی بایگانی اینترنت',
	webcite = 'رده:پیوندهای وب‌کایت الگوی بایگانی اینترنت',
	}


--[[--------------------------< P R E F I X E S >--------------------------------------------------------------

used only with serviceName(), this table holds the two generic tail-text prefixes specified by services['<service name>'][1]

]]

local prefixes = {
	at = 'توسط',
	atthe = 'توسط',
	}


--[=[-------------------------< S E R V I C E S >--------------------------------------------------------------

this is a table of tables for archive services.  Each service table has:
	[1]=prefix; may be boolean true or false, or text string where:
		true indicates that the prefix is taken from prefixes.atthe
		false indicates that the prefix is taken from prefixes.at
		'text string' is used in lieu of the typical 'at' or 'at the' prefix
	[2]=wikilink target article that describes the service; set to nil if not used
	[3]=wikilink label; the label in [[target|label]]; set to nil if not used; when there is not article ([2] is nil) use this to name the service; see wikiwix in the table
	[4]=service ID; set to nil if not used
	[5]=tracking category key from the categories table; set to nil if not used
	[6]=postfix; text string to be appended at the end of the tail string - see webarchive.loc.gov in the table

]=]

local services = {
	['archive.ec'] = {false, 'Archive.today', nil, 'archiveis', categories.archiveis},
	['archive.fo'] = {false, 'Archive.today', nil, 'archiveis', categories.archiveis},
	['archive.is'] = {false, 'Archive.today', nil, 'archiveis', categories.archiveis},
	['archive.li'] = {false, 'Archive.today', nil, 'archiveis', categories.archiveis},
	['archive.md'] = {false, 'Archive.today', nil, 'archiveis', categories.archiveis},
	['archive.org'] = {true, 'Wayback Machine', nil, 'wayback', categories.wayback},
	['archive.ph'] = {false, 'Archive.today', nil, 'archiveis', categories.archiveis},
	['archive.today'] = {false, 'Archive.today', nil, 'archiveis', categories.archiveis},
	['archive.vn'] = {false, 'Archive.today', nil, 'archiveis', categories.archiveis},
	['archive-it.org'] = {false, 'Archive-It', nil, 'archiveit'},
	['arquivo.pt'] = {true, nil, 'بایگانی اینترنت پرتغال'},
	['bibalex.org'] = {false, 'کتابخانه جدید اسکندریه#هرکاری با بایگانی اینترنت', 'کتابخانه جدید اسکندریه'},
	['collectionscanada'] = {true, 'بایگانی اینترنت دولت کانادا'},
	['europarchive.org'] = {true, 'کتابخانه ملی ایرلند'},
	['freezepage.com'] = {false, nil, 'فریزپیج'},
	['haw.nsk'] = {true, 'بایگانی اینترنت کرواسی (HAW)'},
	['langzeitarchivierung.bib-bvb.de'] = {false, 'کتابخانه دولتی بایرن'},
	['loc.gov'] = {true, 'کتابخانه نگره'},
	['nationalarchives.gov.uk'] = {true, 'بایگانی اینترنت دولت بریتانیا'},
	['nlb.gov.sg'] = {false, 'بایگانی اینترنت سنگاپور'},
	['pandora.nla.gov.au'] = {false, 'بایگانی پاندورا'},
	['parliament.uk'] = {true, 'بایگانی اینترنت پارلمان بریتاینا'},
	['perma.cc'] = {false, 'Perma.cc'},
	['perma-archives.cc'] = {false, 'Perma.cc'},
	['proni.gov'] = {true, 'اداره مدارک عمومی ایرلند شمالی'},
	['screenshots.com'] = {false, nil, 'اسکرین‌شاتز'},
	['stanford.edu'] = {true, 'کتابخانه‌های دانشگاه استنفورد', 'بایگانی اینترنت استنفورد'},
	['timetravel.mementoweb.org'] = {false, 'پروژه ممنتو'},
	['uni-lj.si'] = {true, nil, 'بایگانی اینترنت اسلوونی'},
	['veebiarhiiv.digar.ee'] = {true, nil, 'بایگانی اینترنت استونی'},
	['vefsafn.is'] = {true, 'کتابخانه ملی و دانشگاهی ایسلند'},
	['webarchive.bac-lac.gc.ca'] = {false, 'کتابخانه و بایگانی‌های کانادا'},
	['webarchive.loc.gov'] = {true, 'کتابخانه کنگره', nil, 'locwebarchives', nil, 'بایگانی‌های اینترنت'},
	['webarchive.org.uk'] = {true, 'بایگانی اینترنت بریتاینا'},
	['webcache.googleusercontent.com'] = {false, nil, 'گوگل کش'},
	['webcitation.org'] = {false, 'وب‌کایت', nil, 'webcite', categories.webcite},
	['webharvest.gov'] = {true, 'دفتر ملی بایگانی و مدارک آمریکا'},
	['webrecorder.io'] = {false, 'webrecorder.io'},
	['wikiwix.com'] = {false, nil, 'Wikiwix'},
	['yorku.ca'] = {false, 'کتابخانه‌های دانشگاه یورک', 'کتابخانه دیجیتال دانشگاه یورک'},
	}


--[[--------------------------< S T A T I C   T E X T >--------------------------------------------------------

for internationalzation

]]

local s_text = {
	addlarchives = 'بایگانی‌های بیشتر',
	addlpages = 'صفحه‌های بایگانی‌شده بیشتر&nbsp;در',							-- TODO why the &nbsp; there? replace with regular space?
	Archive_index = 'شاخص بایگانی',
	Archived = 'بایگانی‌شده',
	archived = 'بایگانی‌شده',
	archive = 'بایگانی',
	Page = 'صفحه',
	}


--[[--------------------------< E R R _ W A R N _ M S G S >----------------------------------------------------

these tables hold error and warning message text

]]

local err_warn_msgs = {
	date_err = '[خطای تاریخ]',													-- decodeWebciteDate, decodeWaybackDate, decodeArchiveisDate
	date_miss = '[تاریخ ناموجود]',												-- parseExtraArgs
	ts_short = '[طول برچسب زمانی تاریخ]',										-- decodeWaybackDate timestamp less than 8 digits
	ts_date = '[برچسب زمانی تاریخ نامعتبر]',										-- decodeWaybackDate timestamp not a valid date
	unknown_url = '[خطا: نشانی ناشناختهٔ بایگانی]',								-- serviceName
	unnamed_params = '[از پارامترهای مکانی چشم‌پوشی شد]',

--warnings
	mismatch = '<sup>[عدم تطابق تاریخ]</sup>',									-- webarchive
	ts_len = '<sup>[طول برچسب زمانی]</sup>',									-- decodeWaybackDate, decodeArchiveisDate timestamp not 14 digits
	ts_cal = '<sup>[تقویم]</sup>',											-- decodeWaybackDate timestamp has trailing splat
	}


local crit_err_msgs = {															-- critical error messages
	conflicting = 'تداخل |$1= و |$2=',
	empty = 'نشانی خالی',
--	iabot1 = 'https://web.http',												-- TODO: these iabot bugs perportedly fixed; removing these causes lua script error
--	iabot2 = 'Invalid URL',														-- at Template:Webarchive/testcases/Production; resolve that before deleting these messages
	invalid_url = 'نشانی نامعتبر',
	ts_nan = 'برچسب زمانی غیر عددی',
	unknown = 'مشکل ناشناخته. لطفاً در بحث الگو یا وپ:فنی گزارش کنید',
	}



--[[--------------------------< D A T E   I N T E R N A T I O N A L I Z A T I O N >----------------------------

these tables hold data that is used when converting date formats from non-English languages (because mw.language.getContentLanguage:formatDate()
doesn't understand non-English month names)

]]

local month_num = {																-- retain English language names even though they may not be strictly required on the local wiki
	['January'] = 1, ['February'] = 2, ['March'] = 3, ['April'] = 4, ['May'] = 5, ['June'] = 6, ['July'] = 7, ['August'] = 8, ['September'] = 9, ['October'] = 10, ['November'] = 11, ['December'] = 12,
	['Jan'] = 1, ['Feb'] = 2, ['Mar'] = 3, ['Apr'] = 4, ['May'] = 5, ['Jun'] = 6, ['Jul'] = 7, ['Aug'] = 8, ['Sep'] = 9, ['Oct'] = 10, ['Nov'] = 11, ['Dec'] = 12,
-- add local wiki month-names to number translation here
	['ژانویه'] = 1, ['فوریه'] = 2, ['مارس'] = 3, ['آوریل'] = 4, ['مه'] = 5, ['ژوئن'] = 6, ['ژوئیه'] = 7, ['اوت'] = 8, ['سپتامبر'] = 9, ['اکتبر'] = 10, ['نوامبر'] = 11, ['دسامبر'] = 12,	};

																				-- when the local wiki uses non-western digits in dates, local wiki digits must be
																				-- translated to western digits; lua only understands western digits
local digits = {																-- use this table to aid translation
	['۰'] = 0, ['۱'] = 1, ['۲'] = 2, ['۳'] = 3, ['۴'] = 4, ['۵'] = 5, ['۶'] = 6, ['۷'] = 7, ['۸'] = 8, ['۹'] = 9,	-- fill these table indexes with local digits
	enable =true																-- set to true to enable local-digit to western-digit translation
	};


--[[--------------------------< P A R A M E T E R   I N T E R N A T I O N A L I Z A T I O N >------------------

this table holds tables of parameter names and their non-English aliases.  In the enum_params table '#' is a single
character placeholder for 1 or more digit characters

parameter names in this table shall be lowercase
]]

local params = {
	['url'] = {'url'},
	['date'] = {'date', 'datum'},
	['title'] = {'title', 'titel'},
	['nolink'] = {'nolink'},
	['format'] = {'format'}
	}

local enum_params = {
	['url#'] = {'url#'},
	['date#'] = {'date#', 'datum#'},
	['title#'] = {'title#', 'titel#'},
	}

local format_vals = {															-- |format= accepts two values; add local language variants here
	['addlpages'] = {'addlpages'},
	['addlarchives'] = {'addlarchives'},
	}


--[[--------------------------< E X P O R T E D   T A B L E S >------------------------------------------------
]]

return {
	categories = categories,
	config = config,
	crit_err_msgs = crit_err_msgs,
	digits = digits,
	enum_params = enum_params,
	err_warn_msgs = err_warn_msgs,
	excepted_pages = excepted_pages,
	format_vals = format_vals,
	month_num = month_num,
	params = params,
	prefixes = prefixes,
	services = services,
	s_text = s_text,
	uncategorized_namespaces = uncategorized_namespaces,
	uncategorized_subpages = uncategorized_subpages,
	}