تغییرات

پرش به ناوبری پرش به جستجو
۳۶۱ بایت حذف‌شده ،  ‏۱۰ آبان ۱۳۹۸، ساعت ۱۲:۲۴
جز
Fix logic error
سطر ۱: سطر ۱: −
-- برای فارسی‌سازی بهتر، بعضی از قسمت‌های این پودمان تغییر کرده‌است. لطفاً هنگام به‌روزرسانی به توضیحات پودمان توجه کنید.
   
-- This module implements {{documentation}}.
 
-- This module implements {{documentation}}.
   سطر ۳۴: سطر ۳۳:  
expectType = expectType or 'string'
 
expectType = expectType or 'string'
 
if type(msg) ~= expectType then
 
if type(msg) ~= expectType then
error('پیام: خطای نوع در متن cfg.' .. cfgKey .. ' (' .. expectType .. ' انتظار می‌رفت، ' .. type(msg) .. ' بدست آمد)', 2)
+
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
 
end
 
end
 
if not valArray then
 
if not valArray then
سطر ۴۲: سطر ۴۱:  
local function getMessageVal(match)
 
local function getMessageVal(match)
 
match = tonumber(match)
 
match = tonumber(match)
-- برای فارسی‌سازی بهتر، ساختار خطای نمایشی خط زیر تغییر کرده‌است
+
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
return valArray[match] or error('پیام: هیچ مقداری برای کلید $' .. match .. ' در متن cfg.' .. cfgKey .. ' یافت نشد', 4)
   
end
 
end
   سطر ۳۱۰: سطر ۳۰۸:  
if templateTitle.exists and sandboxTitle.exists then
 
if templateTitle.exists and sandboxTitle.exists then
 
local compareUrl = mw.uri.fullUrl(
 
local compareUrl = mw.uri.fullUrl(
'ویژه:مقایسهٔ صفحات',
+
'Special:ComparePages',
 
{page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
 
{page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
 
)
 
)
سطر ۳۷۸: سطر ۳۷۶:  
local testcasesTitle = env.testcasesTitle
 
local testcasesTitle = env.testcasesTitle
 
if testcasesTitle and testcasesTitle.exists then
 
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.namespace == mw.site.namespaces.Module.id then
+
if testcasesTitle.contentModel == "Scribunto" then
 
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
 
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
 
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
 
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
سطر ۴۴۷: سطر ۴۴۵:  
local links
 
local links
 
local content = args.content
 
local content = args.content
if not content then
+
if not content or args[1] then
 
-- No need to include the links if the documentation is on the template page itself.
 
-- No need to include the links if the documentation is on the template page itself.
 
local linksData = p.makeStartBoxLinksData(args, env)
 
local linksData = p.makeStartBoxLinksData(args, env)
سطر ۴۸۵: سطر ۴۸۳:  
if not title or not docTitle then
 
if not title or not docTitle then
 
return nil
 
return nil
 +
end
 +
if docTitle.isRedirect then
 +
docTitle = docTitle.redirectTarget
 
end
 
end
   سطر ۸۷۲: سطر ۸۷۳:  
local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)
 
local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)
 
-- for Modules, add testcases run link if exists
 
-- for Modules, add testcases run link if exists
if subjectSpace == 828 and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
+
if testcasesTitle.contentModel == "Scribunto"  and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
 
local testcasesRunLinkDisplay = message('testcases-run-link-display')
 
local testcasesRunLinkDisplay = message('testcases-run-link-display')
 
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
 
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
سطر ۹۴۳: سطر ۹۴۴:  
end
 
end
 
local subpagesLink = makeWikilink(
 
local subpagesLink = makeWikilink(
'ویژه:نمایه پیشوندی/' .. templateTitle.prefixedText .. '/',
+
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
 
message('subpages-link-display', {pagetype})
 
message('subpages-link-display', {pagetype})
 
)
 
)
کاربر ناشناس

منوی ناوبری