Module:no-entry-subst
Appearance
- The following documentation is located at Module:no-entry-subst/documentation. [edit]
- Useful links: subpage list • links • transclusions • testcases • sandbox
local p = {}
function p.main(frame)
lang = frame.args[1]
templ = {}
templ['verb'] = 'verb'; templ['adjective'] = 'adj'; templ['noun'] = 'noun'
classl = string.lower(frame.args[2])
classf = string.upper(string.sub(classl, 1,1))
class = classf .. string.sub(classl, 2)
class2 = frame.args[3]
meaning = frame.args[4]
etyl = ''
entry_nn = ''
entry_nb = ''
if lang == 'nb' or lang == 'no' then
start = '==Norwegian Bokmål=='
entry_nb = string.format(start .. '\n\n===%s===\n{{nb-%s-%s}}\n\n# [[%s]]', class, templ[classl], class2, meaning)
end
if lang == 'nn' or lang == 'no' then
if lang == 'no' then
start = '\n\n----\n\n==Norwegian Nynorsk=='
else
start = '==Norwegian Nynorsk=='
end
entry_nn = string.format(start .. '\n\n===%s===\n{{nn-%s-%s}}\n\n# [[%s]]', class, templ[classl], class2, meaning)
end
entry = entry_nb .. entry_nn
return entry
end
return p