48,404
edits
No edit summary |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 34: | Line 34: | ||
local namespace = mw.title.getCurrentTitle().namespace | local namespace = mw.title.getCurrentTitle().namespace | ||
local is_content_page = namespace == 0 or namespace == | local is_content_page = namespace == 0 or namespace == 120 | ||
local function process_maybe_split_categories(split_output, categories, prontext, lang, errtext) | local function process_maybe_split_categories(split_output, categories, prontext, lang, errtext) | ||
| Line 118: | Line 118: | ||
prefix_text = '<span class="error">' .. err .. '</span>' | prefix_text = '<span class="error">' .. err .. '</span>' | ||
else | else | ||
prefix_text = "IPA for " .. langname | |||
prefix_text = "[[" .. prefix_text .. "|key]]" | prefix_text = "[[" .. prefix_text .. "|key]]" | ||
end | end | ||
| Line 129: | Line 125: | ||
local IPAs, categories = export.format_IPA_multiple(lang, items, separator, no_count, "raw") | local IPAs, categories = export.format_IPA_multiple(lang, items, separator, no_count, "raw") | ||
local prontext = prefix .. IPAs | local prontext = prefix .. IPAs | ||
| Line 282: | Line 271: | ||
if namespace == 10 then -- Template | if namespace == 10 then -- Template | ||
insert(items, {pron = "/aɪ piː ˈeɪ/"}) | insert(items, {pron = "/aɪ piː ˈeɪ/"}) | ||
end | end | ||
end | end | ||
| Line 416: | Line 403: | ||
-- Strip any reconstruction asterisk and representation marks. | -- Strip any reconstruction asterisk and representation marks. | ||
pron = sub(pron, #opening + 1 + (reconstructed and 1 or 0), -#closing - 1) | pron = sub(pron, #opening + 1 + (reconstructed and 1 or 0), -#closing - 1) | ||
if repr ~= "orthographic" and lang and lang:getCode() == "en" and hasInvalidSeparators(pron) then | if repr ~= "orthographic" and lang and lang:getCode() == "en" and hasInvalidSeparators(pron) then | ||
insert(categories, "English IPA pronunciations with invalid separators") | insert(categories, "English IPA pronunciations with invalid separators") | ||
end | end | ||
| Line 438: | Line 416: | ||
end | end | ||
insert(result, nonstandard) | insert(result, nonstandard) | ||
end | end | ||
| Line 514: | Line 489: | ||
result = ugsub(result, pattern, " ") | result = ugsub(result, pattern, " ") | ||
end | end | ||
end | end | ||
| Line 557: | Line 520: | ||
insert(phonemes, "<span style=\"color: var(--wikt-palette-red,red)\">" .. phoneme .. "</span>") | insert(phonemes, "<span style=\"color: var(--wikt-palette-red,red)\">" .. phoneme .. "</span>") | ||
rest = usub(rest, 2) | rest = usub(rest, 2) | ||
end | end | ||
end | end | ||