Бюрократы, Администраторы интерфейса, Администраторы (Semantic MediaWiki), Кураторы (Semantic MediaWiki), Editors (Semantic MediaWiki), Скрывающие, Администраторы, trusted
69 383
правки
мНет описания правки |
мНет описания правки |
||
Строка 119: | Строка 119: | ||
local language = '' | local language = '' | ||
local origin = '' | local origin = '' | ||
local bts = ' (< | local bts = ' (<i>[['.. frame.args['wiki_page'] ..'|БТС]]</i>)' | ||
-- split 'text@view' value of parameter 'userparam' in two variables | -- split 'text@view' value of parameter 'userparam' in two variables | ||
local i, j = string.find(frame.args['userparam'],'@',1,true) | local i, j = string.find(frame.args['userparam'],'@',1,true) | ||
local text = string.sub(frame.args['userparam'], 1, i-1) | local text = string.sub(frame.args['userparam'], 1, i-1) | ||
local view = string.sub( string.lower(frame.args['userparam']), | local view = string.sub( string.lower(frame.args['userparam']), i+1, -1 ) | ||
-- check if short description is specified | -- check if short description is specified | ||
Строка 147: | Строка 147: | ||
end | end | ||
origin = origin .. frame.args['origin'] .. ')' | origin = origin .. frame.args['origin'] .. ')' | ||
else | |||
origin = language | |||
end | end | ||
Строка 152: | Строка 154: | ||
if view == 'подсказка' or view == 'сноска и подсказка' or view == 'подсказка и сноска' then | if view == 'подсказка' or view == 'сноска и подсказка' or view == 'подсказка и сноска' then | ||
text = '<span style="border-bottom: 1px dotted gray; cursor: help;" title="'.. short_translation .. language ..' (БТС)">'.. text ..'</span>' | text = '<span style="border-bottom: 1px dotted gray; cursor: help;" title="'.. short_translation .. language ..' (БТС)">'.. text ..'</span>' | ||
end | |||
if view == 'сноска' or view == 'сноска и подсказка' or view == 'подсказка и сноска' then | |||
reference = '<ref><i>' .. frame.args['expression'] .. '</i>' .. origin .. ' – ' .. frame.args['translation'] .. bts ..'.</ref>' | reference = '<ref><i>' .. frame.args['expression'] .. '</i>' .. origin .. ' – ' .. frame.args['translation'] .. bts ..'.</ref>' | ||
end | |||
if view == 'скобки' then | |||
text = text ..' ['.. short_translation .. language ..']' | text = text ..' ['.. short_translation .. language ..']' | ||
end | end | ||
Строка 160: | Строка 164: | ||
-- DEBUG. | -- DEBUG. | ||
--text = '<p>DEBUG: view: ' .. view .. "; term: " .. term .. "; description: " .. description .. "; origin: " .. origin .. '</p>' .. text | --text = '<p>DEBUG: view: ' .. view .. "; term: " .. term .. "; description: " .. description .. "; origin: " .. origin .. '</p>' .. text | ||
--return text .. reference | -- return text .. reference ..'; view='.. view ..'; i='.. i | ||
return frame:preprocess( text .. reference ) | return frame:preprocess( text .. reference ) |