Module:gloss grid: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
(Undo revision 31373 by TheNightAvl (talk))
Tag: Undo
No edit summary
Line 22: Line 22:
-- build term row
-- build term row
build("<tr>")
build("<tr>")
if data.IPAs then build("<td />") end -- extra column for alignment
for _, term in ipairs(data.terms) do
for _, term in ipairs(data.terms) do
local cell_type = data.bold and "th" or "td"
local cell_type = data.bold and "th" or "td"
Line 31: Line 32:
if data.IPAs then
if data.IPAs then
build("<tr>")
build("<tr>")
build('<td class="IPA nolarge">' .. (data.phonemic and "/" or "[") .. "</td>")
for i = 1, term_count do
for i = 1, term_count do
if data.IPAs[i] then
if data.IPAs[i] then
local ipa_temp = data.IPAs[i]
local ipa_temp = data.IPAs[i]
if i == 1 then
if i == term_count then
ipa_temp = (data.phonemic and "/ " or "[ ") .. ipa_temp
elseif i == term_count then
ipa_temp = ipa_temp .. (data.phonemic and " /" or " ]")
ipa_temp = ipa_temp .. (data.phonemic and " /" or " ]")
end
end
build('<td style="' .. cell_style .. '" class="IPA nolarge">' .. ipa_temp .. '</td>')
build('<td style="' .. cell_style .. '" class="IPA nolarge">' .. ipa_temp .. '</td>')
elseif i == 1 then
build('<td style="' .. cell_style .. '" class="IPA nolarge">' .. (data.phonemic and "/" or "[") .. '</td>')
elseif i == term_count then
elseif i == term_count then
build('<td style="' .. cell_style .. '; text-align:right" class="IPA nolarge">' .. (data.phonemic and "/" or "]") .. '</td>')
build('<td style="' .. cell_style .. '; text-align:right" class="IPA nolarge">' .. (data.phonemic and "/" or "]") .. '</td>')
Line 54: Line 52:
if data.glosses then
if data.glosses then
build("<tr>")
build("<tr>")
if data.IPAs then build("<td />") end -- extra column for alignment
for i = 1, term_count do
for i = 1, term_count do
if data.glosses[i] then
if data.glosses[i] then
Line 67: Line 66:
if data.translations then
if data.translations then
build("<tr>")
build("<tr>")
if data.IPAs then build("<td />") end -- extra column for alignment
for i = 1, term_count do
for i = 1, term_count do
if data.translations[i] then
if data.translations[i] then
Line 79: Line 79:
-- build combined IPA row
-- build combined IPA row
if data.s_IPA then
if data.s_IPA then
build('<tr><td style="' .. cell_style .. '" class="IPA" colspan=' .. term_count .. '>' .. data.s_IPA .. '</td></tr>')
build("<tr>")
if data.IPAs then build("<td />") end -- extra column for alignment
build('<td style="' .. cell_style .. '" class="IPA" colspan=' .. term_count .. '>' .. data.s_IPA .. '</td></tr>')
end
end
-- build combined translation row
-- build combined translation row
if data.s_translation then
if data.s_translation then
build('<tr><td style="' .. cell_style .. '" colspan=' .. term_count .. '>“' .. data.s_translation .. '”</td></tr>')
build("<tr>")
if data.IPAs then build("<td />") end -- extra column for alignment
build('<td style="' .. cell_style .. '" colspan=' .. term_count .. '>“' .. data.s_translation .. '”</td></tr>')
end
end
build("</table>")
build("</table>")

Navigation menu