Content deleted Content added
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 7:
of the template doesn't work in [[Salammbô]] when |title_orig= exists but does not have a value. When that
happened, the infobox returned plain wikitext [[s:fr:Salammbô|]] which should have been a functioning link.
Placing that wikilink in the article body and previewing
{{#invoke:Infobox/utilities|interlang_wikisource_link_make|{{{orig_lang_code|}}}|{{{native_wikisource|}}}|{{{title_orig|}}}|{{{name|}}} }}
]=]
Line 21:
local title_orig = args_t[3];
local name = args_t[4];
local orig_lang_name = mw.language.fetchLanguageName (orig_lang_code, 'en'); -- get the English name associated with <orig_lang_code>; only language tags known to MediaWiki allowed
if '' == orig_lang_name then -- empty string when <orig_lang_code> invalid
return '<span style="color:#d33">invalid language tag: <span style="font-family:monospace">' .. orig_lang_code .. '</span></span>';
end
Line 38 ⟶ 34:
table.insert (out_t, native_wikisource); -- insert wikisource title
table.insert (out_t, '|'); -- done with link; start label
table.insert (out_t, title_orig or name or mw.title.getCurrentTitle().baseText);
table.insert (out_t, ']]'); -- close inter-language/inter-project wikilink
Line 53 ⟶ 40:
table.insert (out_t, ' at '); -- begin other language wikisource wikilinklink
table.insert (out_t, orig_lang_name); -- add the MediaWiki-known language name associated with |orig_lang_code=
table.insert (out_t, ' [[Wikisource]]'); -- insert wikisource link static text
|