Module:Lang: Difference between revisions
m 1 revision imported |
m 1 revision imported |
||
| (3 intermediate revisions by 3 users not shown) | |||
| Line 47: | Line 47: | ||
local function make_error_span (template, msg) | local function make_error_span (template, msg) | ||
return table.concat ({'<span style="color:#d33">', cfg.misc_text_t.error, ': ', template, msg, '</span>'}) | return table.concat ({'<span style="color:var(--color-error,#d33)">', cfg.misc_text_t.error, ': ', template, msg, '</span>'}) | ||
end | end | ||
| Line 85: | Line 85: | ||
local category_link = ((0 == namespace or 10 == namespace) and not args_t.nocat) and substitute ('[[Category:$1]]', {category}) or ''; | local category_link = ((0 == namespace or 10 == namespace) and not args_t.nocat) and substitute ('[[Category:$1]]', {category}) or ''; | ||
return substitute ('[$1] <span style="color:#d33">$2: {{$3}}: $4 ([[:Category:$5|$6]])</span>$7', -- { prevents template name from being treated as a template call in certain situations | return substitute ('[$1] <span style="color:var(--color-error,#d33)">$2: {{$3}}: $4 ([[:Category:$5|$6]])</span>$7', -- { prevents template name from being treated as a template call in certain situations | ||
{ | { | ||
text or cfg.make_error_msg_t.undefined, | text or cfg.make_error_msg_t.undefined, | ||
| Line 752: | Line 752: | ||
if title_t[std][code] then -- if language code is in the table (xlit may not provide a language code) | if title_t[std][code] then -- if language code is in the table (xlit may not provide a language code) | ||
local fmt_str = '$1$2 ($3 $4) $5'; -- generic format string for tool tip | |||
if language_name:match ('languages') then | |||
fmt_str = '$1$2 ($3) $5'; -- format string for collective languages tool tip | |||
end | |||
title_text = substitute (fmt_str, { -- add the appropriate text to the tool tip | |||
title_text, | title_text, | ||
title_t[std][code:lower()], | title_t[std][code:lower()], | ||