יחידה:Navbox: הבדלים בין גרסאות בדף

אין תקציר עריכה
מ גרסה אחת של הדף wikipedia:he:יחידה:Navbox יובאה
 
(9 גרסאות ביניים של 2 משתמשים אינן מוצגות)
שורה 20: שורה 20:
-- by parent navboxes. The result is that the category shows all pages
-- by parent navboxes. The result is that the category shows all pages
-- where a child navbox is not contained in a parent navbox.
-- where a child navbox is not contained in a parent navbox.
local orphanCat = '[[Category:Navbox orphans]]'
local orphanCat = '[[קטגוריה:תבניות ניווט יתומות]]'
if border == 'subgroup' and args.orphan ~= 'yes' then
if border == 'subgroup' and args.orphan ~= 'yes' then
-- No change; striping occurs in outermost navbox.
-- No change; striping occurs in outermost navbox.
שורה 81: שורה 81:
local function renderNavBar(titleCell)
local function renderNavBar(titleCell)


if args.navbar ~= 'off' and args.navbar ~= 'plain' and not (not args.name and mw.getCurrentFrame():getParent():getTitle():gsub('/sandbox$', '') == 'Template:Navbox') then
if args.navbar ~= 'off' and args.navbar ~= 'plain' and not (not args.name and mw.getCurrentFrame():getParent():getTitle():gsub('/ארגז חול$', '') == 'תבנית:ניווט') then
titleCell:wikitext(navbar{
titleCell:wikitext(navbar{
args.name,
args.name,
שורה 430: שורה 430:
getArgs = require('Module:Arguments').getArgs
getArgs = require('Module:Arguments').getArgs
end
end
args = getArgs(frame, {wrappers = {'Template:Navbox'}})
args = getArgs(frame)
 
-- Translate ordinal Hebrew letters
local translatedArgs = {};
for k,v in pairs(args) do
if mw.ustring.match(k, '[א-ת]') ~=nil then
local enKey = mw.ustring.gsub( k, 'שם', 'name' )
enKey = mw.ustring.gsub( enKey, 'הסתרה', 'state' )
enKey = mw.ustring.gsub( enKey, 'קישורים', 'navbar' )
enKey = mw.ustring.gsub( enKey, 'גבול', 'border' )
enKey = mw.ustring.gsub( enKey, 'סגנון תוכן', 'bodystyle' )
enKey = mw.ustring.gsub( enKey, 'סגנון בסיסי', 'basestyle' )
enKey = mw.ustring.gsub( enKey, 'סגנון כותרת', 'titlestyle' )
enKey = mw.ustring.gsub( enKey, 'סגנון קבוצה', 'groupstyle' )
enKey = mw.ustring.gsub( enKey, 'רוחב קבוצה', 'groupwidth' )
enKey = mw.ustring.gsub( enKey, 'סגנון רשימה', 'liststyle' )
enKey = mw.ustring.gsub( enKey, 'ריפוד רשימה', 'listpadding' )
enKey = mw.ustring.gsub( enKey, 'סגנון אי זוגי', 'oddstyle' )
enKey = mw.ustring.gsub( enKey, 'סגנון זוגי', 'evenstyle' )
enKey = mw.ustring.gsub( enKey, 'זוגי ואי זוגי', 'evenodd' )
enKey = mw.ustring.gsub( enKey, 'סגנון תמונה משמאל', 'imageleftstyle' )
enKey = mw.ustring.gsub( enKey, 'סגנון תמונה', 'imagestyle' )
enKey = mw.ustring.gsub( enKey, 'סגנון למעלה', 'abovestyle' )
enKey = mw.ustring.gsub( enKey, 'סגנון למטה', 'belowstyle' )
enKey = mw.ustring.gsub( enKey, 'מחלקה תבנית', 'navboxclass' )
enKey = mw.ustring.gsub( enKey, 'מחלקה תוכן', 'bodyclass' )
enKey = mw.ustring.gsub( enKey, 'מחלקה כותרת', 'titleclass' )
enKey = mw.ustring.gsub( enKey, 'מחלקה קבוצה', 'groupclass' )
enKey = mw.ustring.gsub( enKey, 'מחלקה רשימה', 'listclass' )
enKey = mw.ustring.gsub( enKey, 'מחלקה למעלה', 'aboveclass' )
enKey = mw.ustring.gsub( enKey, 'מחלקה למטה', 'belowclass' )
enKey = mw.ustring.gsub( enKey, 'מחלקה תמונה', 'imageclass' )
enKey = mw.ustring.gsub( enKey, 'סגנון קבוצה בכותרת', 'titlegroupstyle' )
enKey = mw.ustring.gsub( enKey, 'מחלקה קבוצה בכותרת', 'titlegroupclass' )
enKey = mw.ustring.gsub( enKey, 'קבוצה בכותרת', 'titlegroup' )
enKey = mw.ustring.gsub( enKey, 'סגנון פנימי', 'innerstyle' )
enKey = mw.ustring.gsub( enKey, 'לא לעטוף', 'nowrapitems' )
enKey = mw.ustring.gsub( enKey, 'יתום', 'orphan' )
enKey = mw.ustring.gsub( enKey, 'כותרת', 'title' )
enKey = mw.ustring.gsub( enKey, 'קבוצה', 'group' )
enKey = mw.ustring.gsub( enKey, 'רשימה', 'list' )
enKey = mw.ustring.gsub( enKey, 'סגנון', 'style' )
enKey = mw.ustring.gsub( enKey, 'תמונה משמאל', 'imageleft' )
enKey = mw.ustring.gsub( enKey, 'תמונה', 'image' )
enKey = mw.ustring.gsub( enKey, 'למעלה', 'above' )
enKey = mw.ustring.gsub( enKey, 'למטה', 'below' )
 
translatedArgs[enKey] = v
else
translatedArgs[k] = v
end
end
local paramOptions = {
["state"] = {
["אוטומטי"] = "autocollapse",
["מוסתר"] = "collapsed",
["מורחב"] = "expanded",
["פשוט"] = "plain",
["ללא"] = "off"
},
["navbar"] = {
["פשוט"] = "plain",
["ללא"] = "off"
},
["border"] = {
["צאצא"] = "child",
["תת קבוצה"] = "subgroup",
["ללא"] = "none"
},
["evenodd"] = {
["הפוך"] = "swap",
["זוגי"] = "even",
["אי זוגי"] = "odd",
["ללא"] = "off"
},
["nowrapitems"] = {
["כן"] = "yes"
},
["orphan"] = {
["כן"] = "yes"
}
}
for k,v in pairs(paramOptions) do
for hebrewValue,englishValue in pairs(v) do
if translatedArgs[k] == hebrewValue then
translatedArgs[k] = englishValue
end
end
end


-- Read the arguments in the order they'll be output in, to make references number in the right order.
-- Read the arguments in the order they'll be output in, to make references number in the right order.
local _
local _
_ = args.title
_ = translatedArgs.title
_ = args.above
_ = translatedArgs.above
for i = 1, 20 do
for i = 1, 20 do
_ = args["group" .. tostring(i)]
_ = translatedArgs["group" .. tostring(i)]
_ = args["list" .. tostring(i)]
_ = translatedArgs["list" .. tostring(i)]
end
end
_ = args.below
_ = translatedArgs.below


return p._navbox(args)
return p._navbox(translatedArgs)
end
end


return p
return p