<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki-de.moshellshocker.dns64.de/index.php?action=history&amp;feed=atom&amp;title=Modul%3AVorlage%3ASoft_redirect</id>
	<title>Modul:Vorlage:Soft redirect - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki-de.moshellshocker.dns64.de/index.php?action=history&amp;feed=atom&amp;title=Modul%3AVorlage%3ASoft_redirect"/>
	<link rel="alternate" type="text/html" href="https://wiki-de.moshellshocker.dns64.de/index.php?title=Modul:Vorlage:Soft_redirect&amp;action=history"/>
	<updated>2026-06-01T07:38:31Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Wikipedia (Deutsch) – Lokale Kopie</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki-de.moshellshocker.dns64.de/index.php?title=Modul:Vorlage:Soft_redirect&amp;diff=2929006&amp;oldid=prev</id>
		<title>imported&gt;PerfektesChaos: 2020-12-16</title>
		<link rel="alternate" type="text/html" href="https://wiki-de.moshellshocker.dns64.de/index.php?title=Modul:Vorlage:Soft_redirect&amp;diff=2929006&amp;oldid=prev"/>
		<updated>2020-12-19T16:45:03Z</updated>

		<summary type="html">&lt;p&gt;2020-12-16&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local Softredirect = { suite   = &amp;quot;Softredirect&amp;quot;,&lt;br /&gt;
                       serial  = &amp;quot;2020-12-16&amp;quot;,&lt;br /&gt;
                       item    = 104215207,&lt;br /&gt;
                       globals = { Multilingual = 47541920 }&lt;br /&gt;
                     }&lt;br /&gt;
--[=[&lt;br /&gt;
Q4844001 Template:Soft redirect&lt;br /&gt;
]=]&lt;br /&gt;
local Failsafe  = Softredirect&lt;br /&gt;
local GlobalMod = Softredirect&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Softredirect.trsl = { I18n       = &amp;quot;I18n/Template:Soft redirect&amp;quot;,&lt;br /&gt;
                      err_target = { en = &amp;quot;missing target&amp;quot;,&lt;br /&gt;
                                     cs = &amp;quot;¸ádný cíl&amp;quot;,&lt;br /&gt;
                                     de = &amp;quot;Ziel fehlt&amp;quot; },&lt;br /&gt;
                      err_syntax = { en = &amp;quot;no link syntax&amp;quot;,&lt;br /&gt;
                                     de = &amp;quot;Keine Wikisyntax&amp;quot; }&lt;br /&gt;
                    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local foreignModule = function ( access, advanced, append, alt, alert )&lt;br /&gt;
    -- Fetch global module&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     access    -- string, with name of base module&lt;br /&gt;
    --     advanced  -- true, for require(); else mw.loadData()&lt;br /&gt;
    --     append    -- string, with subpage part, if any; or false&lt;br /&gt;
    --     alt       -- number, of wikidata item of root; or false&lt;br /&gt;
    --     alert     -- true, for throwing error on data problem&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns whatever, probably table&lt;br /&gt;
    -- 2020-01-01&lt;br /&gt;
    local storage = access&lt;br /&gt;
    local finer = function ()&lt;br /&gt;
                      if append then&lt;br /&gt;
                          storage = string.format( &amp;quot;%s/%s&amp;quot;,&lt;br /&gt;
                                                   storage,&lt;br /&gt;
                                                   append )&lt;br /&gt;
                      end&lt;br /&gt;
                  end&lt;br /&gt;
    local fun, lucky, r, suited&lt;br /&gt;
    if advanced then&lt;br /&gt;
        fun = require&lt;br /&gt;
    else&lt;br /&gt;
        fun = mw.loadData&lt;br /&gt;
    end&lt;br /&gt;
    GlobalMod.globalModules = GlobalMod.globalModules or { }&lt;br /&gt;
    suited = GlobalMod.globalModules[ access ]&lt;br /&gt;
    if not suited then&lt;br /&gt;
        finer()&lt;br /&gt;
        lucky, r = pcall( fun,  &amp;quot;Module:&amp;quot; .. storage )&lt;br /&gt;
    end&lt;br /&gt;
    if not lucky then&lt;br /&gt;
        if not suited  and&lt;br /&gt;
           type( alt ) == &amp;quot;number&amp;quot;  and&lt;br /&gt;
           alt &amp;gt; 0 then&lt;br /&gt;
            suited = string.format( &amp;quot;Q%d&amp;quot;, alt )&lt;br /&gt;
            suited = mw.wikibase.getSitelink( suited )&lt;br /&gt;
            GlobalMod.globalModules[ access ] = suited or true&lt;br /&gt;
        end&lt;br /&gt;
        if type( suited ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
            storage = suited&lt;br /&gt;
            finer()&lt;br /&gt;
            lucky, r = pcall( fun, storage )&lt;br /&gt;
        end&lt;br /&gt;
        if not lucky and alert then&lt;br /&gt;
            error( &amp;quot;Missing or invalid page: &amp;quot; .. storage )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- foreignModule()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local function faraway( alert )&lt;br /&gt;
    -- Retrieve message in appropriate language&lt;br /&gt;
    -- Parameter:&lt;br /&gt;
    --     alert  -- string, with message key&lt;br /&gt;
    -- Returns string&lt;br /&gt;
    local got, r&lt;br /&gt;
    if type( Softredirect.ext ) ~= &amp;quot;table&amp;quot; then&lt;br /&gt;
        Softredirect.ext = { }&lt;br /&gt;
    end&lt;br /&gt;
    got = Softredirect.ext.Multilingual&lt;br /&gt;
    if not got  and  got ~= false then&lt;br /&gt;
        local item = Softredirect.globals.Multilingual&lt;br /&gt;
        got = foreignModule( &amp;quot;Multilingual&amp;quot;, true, false, item )&lt;br /&gt;
        if type( got ) == &amp;quot;table&amp;quot;   and&lt;br /&gt;
           type( got.Multilingual ) == &amp;quot;function&amp;quot; then&lt;br /&gt;
            got = got.Multilingual()&lt;br /&gt;
        else&lt;br /&gt;
            got = false&lt;br /&gt;
        end&lt;br /&gt;
        Softredirect.ext.Multilingual = got&lt;br /&gt;
    end&lt;br /&gt;
    if got   and&lt;br /&gt;
       type( got.tabData ) == &amp;quot;function&amp;quot; then&lt;br /&gt;
        local r1, r2 = got.tabData( Softredirect.trsl.I18n, alert )&lt;br /&gt;
        if r2 ~= &amp;quot;error&amp;quot; then&lt;br /&gt;
            r = r1&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    if not r then&lt;br /&gt;
        local slang = mw.language.getContentLanguage():getCode()&lt;br /&gt;
        local trsl  = Softredirect.trsl[ alert ]&lt;br /&gt;
        slang = slang:match( &amp;quot;^(%l+)%-?.*&amp;quot; )&lt;br /&gt;
        r     = trsl[ slang ]  or  trsl.en&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- faraway()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local function fault( alert )&lt;br /&gt;
    -- Format error message&lt;br /&gt;
    -- Parameter:&lt;br /&gt;
    --     alert  -- string, with complaint&lt;br /&gt;
    -- Returns string&lt;br /&gt;
    local e = mw.html.create( &amp;quot;span&amp;quot; )&lt;br /&gt;
                     :attr( &amp;quot;class&amp;quot;, &amp;quot;error&amp;quot; )&lt;br /&gt;
                     :wikitext( alert )&lt;br /&gt;
    return tostring( e )&lt;br /&gt;
end -- fault()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Failsafe.failsafe = function ( atleast )&lt;br /&gt;
    -- Retrieve versioning and check for compliance&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     atleast  -- string, with required version&lt;br /&gt;
    --                         or wikidata|item|~|@ or false&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns  string  -- with queried version/item, also if problem&lt;br /&gt;
    --              false   -- if appropriate&lt;br /&gt;
    -- 2020-08-17&lt;br /&gt;
    local since = atleast&lt;br /&gt;
    local last    = ( since == &amp;quot;~&amp;quot; )&lt;br /&gt;
    local linked  = ( since == &amp;quot;@&amp;quot; )&lt;br /&gt;
    local link    = ( since == &amp;quot;item&amp;quot; )&lt;br /&gt;
    local r&lt;br /&gt;
    if last  or  link  or  linked  or  since == &amp;quot;wikidata&amp;quot; then&lt;br /&gt;
        local item = Failsafe.item&lt;br /&gt;
        since = false&lt;br /&gt;
        if type( item ) == &amp;quot;number&amp;quot;  and  item &amp;gt; 0 then&lt;br /&gt;
            local suited = string.format( &amp;quot;Q%d&amp;quot;, item )&lt;br /&gt;
            if link then&lt;br /&gt;
                r = suited&lt;br /&gt;
            else&lt;br /&gt;
                local entity = mw.wikibase.getEntity( suited )&lt;br /&gt;
                if type( entity ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
                    local seek = Failsafe.serialProperty or &amp;quot;P348&amp;quot;&lt;br /&gt;
                    local vsn  = entity:formatPropertyValues( seek )&lt;br /&gt;
                    if type( vsn ) == &amp;quot;table&amp;quot;  and&lt;br /&gt;
                       type( vsn.value ) == &amp;quot;string&amp;quot;  and&lt;br /&gt;
                       vsn.value ~= &amp;quot;&amp;quot; then&lt;br /&gt;
                        if last  and  vsn.value == Failsafe.serial then&lt;br /&gt;
                            r = false&lt;br /&gt;
                        elseif linked then&lt;br /&gt;
                            if mw.title.getCurrentTitle().prefixedText&lt;br /&gt;
                               ==  mw.wikibase.getSitelink( suited ) then&lt;br /&gt;
                                r = false&lt;br /&gt;
                            else&lt;br /&gt;
                                r = suited&lt;br /&gt;
                            end&lt;br /&gt;
                        else&lt;br /&gt;
                            r = vsn.value&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    if type( r ) == &amp;quot;nil&amp;quot; then&lt;br /&gt;
        if not since  or  since &amp;lt;= Failsafe.serial then&lt;br /&gt;
            r = Failsafe.serial&lt;br /&gt;
        else&lt;br /&gt;
            r = false&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- Failsafe.failsafe()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Export&lt;br /&gt;
local p = { }&lt;br /&gt;
&lt;br /&gt;
function p.f( frame )&lt;br /&gt;
    local params = frame:getParent().args&lt;br /&gt;
    local shift = mw.text.trim( params[ 1 ] or &amp;quot;&amp;quot; )&lt;br /&gt;
    local r&lt;br /&gt;
    if shift:sub( 1, 1 ) == &amp;quot;:&amp;quot; then&lt;br /&gt;
        shift = mw.text.trim( shift:sub( 2 ) )&lt;br /&gt;
    end&lt;br /&gt;
    if shift == &amp;quot;&amp;quot; then&lt;br /&gt;
        r = fault( faraway( &amp;quot;err_target&amp;quot; ) )&lt;br /&gt;
    else&lt;br /&gt;
        if shift:match( &amp;quot;^%[%[.+%]%]$&amp;quot; )   or&lt;br /&gt;
           shift:match( &amp;quot;^%[%l*:?//[^/%s]+%.%l%l.+%]$&amp;quot; ) then&lt;br /&gt;
            r = shift&lt;br /&gt;
        elseif shift:match( &amp;quot;^%l*:?//[^/%[%]&amp;lt;&amp;gt;%s]+%.%l%l[^&amp;lt;&amp;gt;%[%]]+ [^&amp;lt;&amp;gt;%[%]]+$&amp;quot; ) then&lt;br /&gt;
            r = string.format( &amp;quot;[%s]&amp;quot;, shift )&lt;br /&gt;
        else&lt;br /&gt;
            if shift:match( &amp;quot;[%[|%]]&amp;quot; ) then&lt;br /&gt;
                r = fault( faraway( &amp;quot;err_syntax&amp;quot; ) )&lt;br /&gt;
            else&lt;br /&gt;
                local show = mw.text.trim( params[ 2 ] or &amp;quot;&amp;quot; )&lt;br /&gt;
                local s    = shift .. &amp;quot;/&amp;quot;&lt;br /&gt;
                if show == &amp;quot;&amp;quot; then&lt;br /&gt;
                    show = shift&lt;br /&gt;
                end&lt;br /&gt;
                if s:match( &amp;quot;^%l*:?//[^/%s]+%.%l%l+/%S*$&amp;quot; ) then&lt;br /&gt;
                    r = string.format( &amp;quot;[%s %s]&amp;quot;, shift, show )&lt;br /&gt;
                else&lt;br /&gt;
                    r = string.format( &amp;quot;[[:%s|%s]]&amp;quot;, shift, show )&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.failsafe = function ( frame )&lt;br /&gt;
    -- Versioning interface&lt;br /&gt;
    local s = type( frame )&lt;br /&gt;
    local since&lt;br /&gt;
    if s == &amp;quot;table&amp;quot; then&lt;br /&gt;
        since = frame.args[ 1 ]&lt;br /&gt;
    elseif s == &amp;quot;string&amp;quot; then&lt;br /&gt;
        since = frame&lt;br /&gt;
    end&lt;br /&gt;
    if since then&lt;br /&gt;
        since = mw.text.trim( since )&lt;br /&gt;
        if since == &amp;quot;&amp;quot; then&lt;br /&gt;
            since = false&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return Failsafe.failsafe( since )  or  &amp;quot;&amp;quot;&lt;br /&gt;
end -- p.failsafe&lt;br /&gt;
&lt;br /&gt;
p.Softredirect = function ()&lt;br /&gt;
    return Softredirect&lt;br /&gt;
end -- p.Softredirect&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;PerfektesChaos</name></author>
	</entry>
</feed>