יחידה:Navbox: הבדלים בין גרסאות בדף
מ שחזור זמני |
מ תרגום פרמטרים; הכנה לקראת הטמעה |
||
| שורה 430: | שורה 430: | ||
getArgs = require('Module:Arguments').getArgs | getArgs = require('Module:Arguments').getArgs | ||
end | end | ||
args = getArgs(frame, { | 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, 'מחלקה תוכן', 'bodyclass' ) | |||
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, 'מחלקה כותרת קבוצה', 'titlegroupstyle' ) | |||
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"] = { | |||
["ללא"] = "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 _ | ||
_ = | _ = translatedArgs.title | ||
_ = | _ = translatedArgs.above | ||
for i = 1, 20 do | for i = 1, 20 do | ||
_ = | _ = translatedArgs["group" .. tostring(i)] | ||
_ = | _ = translatedArgs["list" .. tostring(i)] | ||
end | end | ||
_ = | _ = translatedArgs.below | ||
return p._navbox( | return p._navbox(translatedArgs) | ||
end | end | ||
return p | return p | ||