Module:Interwiki extra
Appearance
![]() | This module is rated as alpha. It is ready for third-party input, and may be used on a few pages to see if problems arise, but should be watched. Suggestions for new features or changes in their input and output mechanisms are welcome. |
![]() | This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
Usage
{{#invoke:Interwiki extra|interwiki}}
See also {{Interwiki extra}} — wrapper.
Pages that use this module to add additional interwiki links are contained in the tracking category Category:Module:Interwiki extra: additional interwiki links (1,214).
-- This is the interwiki library. It is not meant to be used directly in articles, but to be used by other Lua modules.
local interwikiTable = mw.loadData( 'Module:InterwikiTable' )
local iw = {}
local function getProjectCode( prefix )
for projectCode, projectVal in pairs( interwikiTable ) do
for _, iwCode in ipairs( projectVal.iw_prefix ) do
if iwCode == prefix then
return projectCode
end
end
end
return nil
end
function iw.isKnownPrefix( prefix )
return getProjectCode( prefix ) and true or false
end
return iw