پرش به محتوا

پودمان:File link: تفاوت میان نسخه‌ها

۸۳ بایت اضافه‌شده ،  ‏۷ مهٔ ۲۰۲۱
صفحه‌ای تازه حاوی «-- This module provides a library for formatting file wikilinks. local yesno = require('Module:Yesno') local checkType = require('libraryU...» ایجاد کرد
fa>Wikivahdat
(Undid revision 948472508 by [[Special:Contributions/w>IPad365|w>IPad365]] ([[User talk:w>IPad365|talk]]))
 
(صفحه‌ای تازه حاوی «-- This module provides a library for formatting file wikilinks. local yesno = require('Module:Yesno') local checkType = require('libraryU...» ایجاد کرد)
خط ۱۴: خط ۱۴:
if type(val) ~= 'string' then
if type(val) ~= 'string' then
error(string.format(
error(string.format(
"type error in '%s' parameter of '_main' (expected string, got %s)",
"خطای نوع در پارامتر «%s» از «_main» (رشته انتظار می‌رفت، %s دریافت شد)",
key, type(val)
key, type(val)
), level)
), level)
خط ۴۵: خط ۴۵:
-- Filename
-- Filename
checkArg('file', args.file, 3)
checkArg('file', args.file, 3)
ret[#ret + 1] = 'File:' .. args.file
ret[#ret + 1] = 'پرونده:' .. args.file


-- Format
-- Format
خط ۸۲: خط ۸۲:
function p.main(frame)
function p.main(frame)
local origArgs = require('Module:Arguments').getArgs(frame, {
local origArgs = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:File link'
wrappers = 'الگو:File link'
})
})
if not origArgs.file then
if not origArgs.file then
error("'file' parameter missing from [[Template:File link]]", 0)
error("پارامتر «file» از [[الگو:File link]] حذف شده‌است", 0)
end
end


۸٬۱۲۶

ویرایش