
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://www.freewiki.eu/de/index.php?action=history&amp;feed=atom&amp;title=Modul%3AISO15924</id>
	<title>Modul:ISO15924 - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://www.freewiki.eu/de/index.php?action=history&amp;feed=atom&amp;title=Modul%3AISO15924"/>
	<link rel="alternate" type="text/html" href="https://www.freewiki.eu/de/index.php?title=Modul:ISO15924&amp;action=history"/>
	<updated>2026-05-05T06:33:49Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in FreeWiki</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://www.freewiki.eu/de/index.php?title=Modul:ISO15924&amp;diff=5329&amp;oldid=prev</id>
		<title>Admin: 1 Version importiert</title>
		<link rel="alternate" type="text/html" href="https://www.freewiki.eu/de/index.php?title=Modul:ISO15924&amp;diff=5329&amp;oldid=prev"/>
		<updated>2020-02-06T19:37:13Z</updated>

		<summary type="html">&lt;p&gt;1 Version importiert&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Version vom 6. Februar 2020, 19:37 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;de&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(kein Unterschied)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
		
	</entry>
	<entry>
		<id>https://www.freewiki.eu/de/index.php?title=Modul:ISO15924&amp;diff=5328&amp;oldid=prev</id>
		<title>mo&gt;PerfektesChaos: 2020-01-31</title>
		<link rel="alternate" type="text/html" href="https://www.freewiki.eu/de/index.php?title=Modul:ISO15924&amp;diff=5328&amp;oldid=prev"/>
		<updated>2020-01-31T15:09:42Z</updated>

		<summary type="html">&lt;p&gt;2020-01-31&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local ISO15924 = { suite   = &amp;quot;ISO15924&amp;quot;,&lt;br /&gt;
                   serial  = &amp;quot;2020-01-31&amp;quot;,&lt;br /&gt;
                   item    = 71584769,&lt;br /&gt;
                   statics = &amp;quot;codes&amp;quot; }&lt;br /&gt;
--[=[&lt;br /&gt;
ISO 15924 support for scripting systems&lt;br /&gt;
* fetch()&lt;br /&gt;
* getLanguageScript()&lt;br /&gt;
* getScripts()&lt;br /&gt;
* isCJK()&lt;br /&gt;
* isRTL()&lt;br /&gt;
* isScript()&lt;br /&gt;
* isTrans()&lt;br /&gt;
* scriptName()&lt;br /&gt;
* showScripts()&lt;br /&gt;
* testScripts()&lt;br /&gt;
* failsafe()&lt;br /&gt;
]=]&lt;br /&gt;
local Failsafe  = ISO15924&lt;br /&gt;
local GlobalMod = ISO15924&lt;br /&gt;
local Unicode&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ISO15924.Text    = { }&lt;br /&gt;
ISO15924.Unicode = { }&lt;br /&gt;
Unicode = ISO15924.Unicode&lt;br /&gt;
Unicode.RomanN = { bef = {   [ 32 ] = true,&lt;br /&gt;
                            [ 160 ] = true,&lt;br /&gt;
                           [ 8239 ] = true,&lt;br /&gt;
                             [ 40 ] = true,&lt;br /&gt;
                             [ 45 ] = true,&lt;br /&gt;
                             [ 91 ] = true&lt;br /&gt;
                         },&lt;br /&gt;
                   dig = { [ 73 ] = true,    -- I&lt;br /&gt;
                           [ 86 ] = true,    -- V&lt;br /&gt;
                           [ 88 ] = true,    -- X&lt;br /&gt;
                           [ 76 ] = true,    -- L&lt;br /&gt;
                           [ 67 ] = true,    -- C&lt;br /&gt;
                           [ 68 ] = true,    -- D&lt;br /&gt;
                           [ 77 ] = true     -- M&lt;br /&gt;
                         },&lt;br /&gt;
                   fol = {   [ 32 ] = true,&lt;br /&gt;
                            [ 160 ] = true,&lt;br /&gt;
                           [ 8239 ] = true,&lt;br /&gt;
                             [ 41 ] = true,&lt;br /&gt;
                             [ 44 ] = true,&lt;br /&gt;
                             [ 46 ] = true,&lt;br /&gt;
                             [ 93 ] = true&lt;br /&gt;
                         } }&lt;br /&gt;
ISO15924.Commons = { &amp;quot;cjk&amp;quot;,&lt;br /&gt;
                     &amp;quot;iso639script&amp;quot;,&lt;br /&gt;
                     &amp;quot;reverse&amp;quot;,&lt;br /&gt;
                     &amp;quot;rtl&amp;quot;,&lt;br /&gt;
                     &amp;quot;trans&amp;quot;,&lt;br /&gt;
                     &amp;quot;unicodes&amp;quot; }&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;
    -- 2019-10-29&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, 0 )&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 fill( accumulate, assign, append )&lt;br /&gt;
    -- Copy external sequence into local collection&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     accumulate  -- table, with relevant definitions&lt;br /&gt;
    --     assign      -- table, with assigned definitions&lt;br /&gt;
    --     append      -- table, if code names to be appended to entries&lt;br /&gt;
    if type( assign ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
        local e&lt;br /&gt;
        for k, v in pairs( assign ) do&lt;br /&gt;
            if type( v ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
                e = { }&lt;br /&gt;
                for kk, vv in pairs( v ) do&lt;br /&gt;
                    table.insert( e, vv )&lt;br /&gt;
                end -- for kk, vv&lt;br /&gt;
                if append then&lt;br /&gt;
                     for i = 1, #append do&lt;br /&gt;
                        table.insert( e, append[ i ] )&lt;br /&gt;
                    end -- for i&lt;br /&gt;
                end&lt;br /&gt;
                table.insert( accumulate, e )&lt;br /&gt;
            end&lt;br /&gt;
        end -- for k, v&lt;br /&gt;
    end&lt;br /&gt;
end -- fill()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local function fulfil( ask, attribute )&lt;br /&gt;
    -- Check whether script has a certain attribute&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     ask  -- string, with language or script code&lt;br /&gt;
    --     attribute  -- string, with &amp;quot;cjk&amp;quot; or &amp;quot;rtl&amp;quot;&lt;br /&gt;
    -- Returns true, if matchin&lt;br /&gt;
    local got = ISO15924.fetch( attribute )&lt;br /&gt;
    local r&lt;br /&gt;
    if type( got ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
        local n = #ask&lt;br /&gt;
        local script&lt;br /&gt;
        if n == 4 then&lt;br /&gt;
            script = ask&lt;br /&gt;
        elseif n &amp;lt; 4 then&lt;br /&gt;
            script = ISO15924.getLanguageScript( ask )&lt;br /&gt;
        else&lt;br /&gt;
            script = ask:match( &amp;quot;^%a%a%a?%-(%a%a%a%a)$&amp;quot; )&lt;br /&gt;
            if not script then&lt;br /&gt;
                script = ask:match( &amp;quot;^(%a%a%a?)%-%a%a$&amp;quot; )&lt;br /&gt;
                script = ISO15924.getLanguageScript( script )&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        if script then&lt;br /&gt;
            script = script:sub( 1, 1 ):upper() ..&lt;br /&gt;
                     script:sub( 2 ):lower()&lt;br /&gt;
            r = got[ script ]&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r or false&lt;br /&gt;
end -- fulfil()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ISO15924.Text.scriptName = function ( assigned, alien, add )&lt;br /&gt;
    -- Retrieve script name, hopefully linked&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     assigned  -- string, with script code&lt;br /&gt;
    --     alien     -- string, with language code, or not&lt;br /&gt;
    --     add       -- arbitrary additional information&lt;br /&gt;
    -- Returns string&lt;br /&gt;
    local r, trsl&lt;br /&gt;
    if type( assigned ) == &amp;quot;string&amp;quot;  and&lt;br /&gt;
       assigned:match( &amp;quot;^%u%l%l%l$&amp;quot; ) then&lt;br /&gt;
        trsl = ISO15924.fetch( &amp;quot;translate&amp;quot; )&lt;br /&gt;
        r    = assigned&lt;br /&gt;
    else&lt;br /&gt;
        r = &amp;quot;&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    if type( trsl ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
        local slang&lt;br /&gt;
        if type( alien ) == &amp;quot;string&amp;quot;  and&lt;br /&gt;
           alien:match( &amp;quot;^%l%l%l?%-?&amp;quot; ) then&lt;br /&gt;
            slang = alien:lower()&lt;br /&gt;
        end&lt;br /&gt;
        if not slang then&lt;br /&gt;
            if not ISO15924.Text.sublang then&lt;br /&gt;
                local title = mw.title.getCurrentTitle()&lt;br /&gt;
                ISO15924.Text.sublang = title.text:match( &amp;quot;/%l%l%l?$&amp;quot; )&lt;br /&gt;
                ISO15924.Text.sublang = ISO15924.Text.sublang or true&lt;br /&gt;
            end&lt;br /&gt;
            if type( ISO15924.Text.sublang ) == &amp;quot;string&amp;quot;  and&lt;br /&gt;
               type( trsl[ ISO15924.Text.sublang ] ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
                slang = ISO15924.Text.sublang&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        if not slang then&lt;br /&gt;
            if not ISO15924.Text.sitelang then&lt;br /&gt;
                local contLang = mw.language.getContentLanguage()&lt;br /&gt;
                ISO15924.Text.sitelang = contLang:getCode():lower()&lt;br /&gt;
            end&lt;br /&gt;
            slang = ISO15924.Text.sitelang&lt;br /&gt;
        end&lt;br /&gt;
        if type( trsl[ slang ] ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
            trsl = trsl[ slang ]&lt;br /&gt;
        elseif type( trsl.en ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
            trsl  = trsl.en&lt;br /&gt;
            slang = &amp;quot;en&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
            trsl = false&lt;br /&gt;
        end&lt;br /&gt;
        if trsl then&lt;br /&gt;
            local pages = ISO15924.fetch( &amp;quot;pages&amp;quot; )&lt;br /&gt;
            trsl = trsl[ assigned ]&lt;br /&gt;
            if type( trsl ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
                r = trsl&lt;br /&gt;
            elseif type( trsl ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
                if type( trsl[ 1 ] ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
                    r = trsl[ 1 ]&lt;br /&gt;
                    if add  and  slang == &amp;quot;de&amp;quot; then&lt;br /&gt;
                        if tonumber( add ) == 2  and&lt;br /&gt;
                           type( trsl[ 2 ] ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
                            r = trsl[ 2 ]&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
            if type( pages ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
                local p&lt;br /&gt;
                for k, v in pairs( pages ) do&lt;br /&gt;
                    if type( v ) == &amp;quot;table&amp;quot;  and  v.lang == slang then&lt;br /&gt;
                        p = v&lt;br /&gt;
                        break    -- for k, v&lt;br /&gt;
                    end&lt;br /&gt;
                end -- for k, v&lt;br /&gt;
                if p  and  type( p.targets ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
                    p = p.targets[ assigned ]&lt;br /&gt;
                    if type( p ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
                        -- different server issues --&lt;br /&gt;
                        if mw.ustring.upper( mw.ustring.sub( p, 1, 1 ) )&lt;br /&gt;
                           ~=&lt;br /&gt;
                           mw.ustring.upper( mw.ustring.sub( r, 1, 1 ) )&lt;br /&gt;
                           or  mw.ustring.sub( p, 2 ) ~=&lt;br /&gt;
                               mw.ustring.sub( r, 2 ) then&lt;br /&gt;
                            r = string.format( &amp;quot;%s|%s&amp;quot;, p, r )&lt;br /&gt;
                        end&lt;br /&gt;
                        r = string.format( &amp;quot;[[%s]]&amp;quot;, r )&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
            if add  and  slang == &amp;quot;de&amp;quot; then&lt;br /&gt;
                if tonumber( add ) == 2 then&lt;br /&gt;
                    local s = &amp;quot;in &amp;quot;&lt;br /&gt;
                    if type( trsl ) == &amp;quot;table&amp;quot; and&lt;br /&gt;
                       type( trsl[ 3 ] ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
                        s = trsl[ 3 ] .. &amp;quot; &amp;quot;&lt;br /&gt;
                    end&lt;br /&gt;
                    r = s .. r&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 -- ISO15924.Text.scriptName()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unicode.flat = function ( analyse )&lt;br /&gt;
    -- Remove markup and syntax from wikitext&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     analyse  -- string, with wikitext&lt;br /&gt;
    -- Returns string, with cleaned content plain text&lt;br /&gt;
    local r = analyse&lt;br /&gt;
    if r:find( &amp;quot;&amp;amp;&amp;quot;, 1, true ) then&lt;br /&gt;
        r = mw.text.decode( r, true )&lt;br /&gt;
    end&lt;br /&gt;
    r = mw.text.trim( mw.text.unstrip( r ) )&lt;br /&gt;
    if r:find( &amp;quot;&amp;lt;&amp;quot;, 1, true )  and&lt;br /&gt;
       r:find( &amp;quot;&amp;gt;&amp;quot;, 1, true ) then&lt;br /&gt;
        r = r:gsub( &amp;quot;(&amp;lt;/?%l[^&amp;gt;]*&amp;gt;)&amp;quot;, &amp;quot;&amp;quot; )&lt;br /&gt;
    end&lt;br /&gt;
    if r:find( &amp;quot;[&amp;quot;, 1, true )    and&lt;br /&gt;
       ( ( r:find( &amp;quot;[[&amp;quot;, 1, true )  and&lt;br /&gt;
           r:find( &amp;quot;]]&amp;quot;, 1, true ) )   or&lt;br /&gt;
         r:find( &amp;quot;[http&amp;quot;, 1, true )   or&lt;br /&gt;
         r:find( &amp;quot;[//&amp;quot;, 1, true ) ) then&lt;br /&gt;
        local lucky, WLink = pcall( require, &amp;quot;Module:WLink&amp;quot; )&lt;br /&gt;
        if type( WLink ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
            r = WLink.WLink().getPlain( r )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- Unicode.flat()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unicode.getRanges = function ()&lt;br /&gt;
    -- Retrieve collection of Unicode ranges&lt;br /&gt;
    -- Returns table, with all relations codepoint / scripts&lt;br /&gt;
    if type( Unicode.ranges ) ~= &amp;quot;table&amp;quot; then&lt;br /&gt;
        local e, unique&lt;br /&gt;
        Unicode.ranges = { }&lt;br /&gt;
        unique = ISO15924.fetch( &amp;quot;reverse&amp;quot; )&lt;br /&gt;
        for k, range in pairs( unique ) do&lt;br /&gt;
            e = { }&lt;br /&gt;
            for j, v in pairs( range ) do&lt;br /&gt;
                table.insert( e, v )&lt;br /&gt;
            end -- for j, v&lt;br /&gt;
            table.insert( Unicode.ranges, e )&lt;br /&gt;
        end -- for k, range&lt;br /&gt;
    end&lt;br /&gt;
    return Unicode.ranges&lt;br /&gt;
end -- Unicode.getRanges()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unicode.getScripts = function ( allow, analyse, assume )&lt;br /&gt;
    -- Check all chars for expected script code ranges&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     allow    -- table, with permitted unspecific ranges&lt;br /&gt;
    --     analyse  -- string or number or table, with text&lt;br /&gt;
    --     assume   -- string, or nil, with ID of expected script&lt;br /&gt;
    -- Returns table, with all relations codepoint / scripts&lt;br /&gt;
    local uc = Unicode.getRanges()&lt;br /&gt;
    local cp = type( analyse )&lt;br /&gt;
    local r  = { }&lt;br /&gt;
    local e, n, p, s, v&lt;br /&gt;
    if cp == &amp;quot;string&amp;quot; then&lt;br /&gt;
        e  = Unicode.flat( analyse )&lt;br /&gt;
        cp = { }&lt;br /&gt;
        n  = mw.ustring.len( e )&lt;br /&gt;
        for i = 1, n do&lt;br /&gt;
            table.insert( cp,  mw.ustring.codepoint( e, i, i ) )&lt;br /&gt;
        end -- for i&lt;br /&gt;
    elseif cp == &amp;quot;table&amp;quot; then&lt;br /&gt;
        cp = analyse&lt;br /&gt;
    elseif cp == &amp;quot;number&amp;quot; then&lt;br /&gt;
        cp = { analyse }&lt;br /&gt;
    end&lt;br /&gt;
    for i = 1, #cp do&lt;br /&gt;
        n = cp[ i ]&lt;br /&gt;
        p = { n, false }&lt;br /&gt;
        for k = 1, #uc do&lt;br /&gt;
            e = uc[ k ]&lt;br /&gt;
            if n &amp;lt;= e[ 2 ] then&lt;br /&gt;
                if n &amp;gt;= e[ 1 ] then&lt;br /&gt;
                    v = e[ 3 ]&lt;br /&gt;
                    if type( v ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
                        s = v[ 1 ]&lt;br /&gt;
                        if assume then&lt;br /&gt;
                            for j = 2, #v do&lt;br /&gt;
                                if v[ j ] == assume then&lt;br /&gt;
                                    s = v[ j ]&lt;br /&gt;
                                    break -- for j&lt;br /&gt;
                                end&lt;br /&gt;
                            end -- for j&lt;br /&gt;
                        end&lt;br /&gt;
                    else&lt;br /&gt;
                        s = &amp;quot;???&amp;quot;&lt;br /&gt;
                    end&lt;br /&gt;
                    p[ 2 ] = s&lt;br /&gt;
                    n = false&lt;br /&gt;
                end&lt;br /&gt;
                break -- for k&lt;br /&gt;
            elseif n &amp;lt; e[ 1 ] then&lt;br /&gt;
                break -- for k&lt;br /&gt;
            end&lt;br /&gt;
        end -- for k&lt;br /&gt;
        if n then&lt;br /&gt;
            for j = 1, #allow do&lt;br /&gt;
                e = allow[ j ]&lt;br /&gt;
                if n &amp;lt;= e[ 2 ] then&lt;br /&gt;
                    if n &amp;gt;= e[ 1 ] then&lt;br /&gt;
                        p[ 2 ] = true&lt;br /&gt;
                    end&lt;br /&gt;
                    break -- for j&lt;br /&gt;
                elseif n &amp;lt; e[ 1 ] then&lt;br /&gt;
                    break -- for j&lt;br /&gt;
                end&lt;br /&gt;
            end -- for j&lt;br /&gt;
        end&lt;br /&gt;
        table.insert( r, p )&lt;br /&gt;
    end -- for i&lt;br /&gt;
    return r&lt;br /&gt;
end -- Unicode.getScripts()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unicode.isScript = function ( all, ask, analyse )&lt;br /&gt;
    -- Check all chars for expected script code ranges&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     all      -- table, with all definitions&lt;br /&gt;
    --     ask      -- string, with supposed script code&lt;br /&gt;
    --     analyse  -- string or number or table, with text&lt;br /&gt;
    -- Returns&lt;br /&gt;
    --     1. true, if all chars within&lt;br /&gt;
    --     2. table, with analyse text&lt;br /&gt;
    local f = function ( array, amount, a )&lt;br /&gt;
                  local k = a&lt;br /&gt;
                  local e&lt;br /&gt;
                  for i = 1, amount do&lt;br /&gt;
                      e = array[ i ]&lt;br /&gt;
                      if k &amp;gt;= e[ 1 ] then&lt;br /&gt;
                          if k &amp;lt;= e[ 2 ] then&lt;br /&gt;
                              k = false&lt;br /&gt;
                              break -- for i&lt;br /&gt;
                          end&lt;br /&gt;
                      else&lt;br /&gt;
                          break -- for i&lt;br /&gt;
                      end&lt;br /&gt;
                  end -- for i&lt;br /&gt;
                  return k&lt;br /&gt;
              end&lt;br /&gt;
    local s  = analyse&lt;br /&gt;
    local cp = type( s )&lt;br /&gt;
    local uc = { }&lt;br /&gt;
    local xx = { }&lt;br /&gt;
    local r  = true&lt;br /&gt;
    local m, na, nu, nx&lt;br /&gt;
    if cp == &amp;quot;string&amp;quot; then&lt;br /&gt;
        s  =  Unicode.flat( s )&lt;br /&gt;
        cp = { }&lt;br /&gt;
        na = mw.ustring.len( s )&lt;br /&gt;
        for i = 1, na do&lt;br /&gt;
            table.insert( cp,  mw.ustring.codepoint( s, i, i ) )&lt;br /&gt;
        end -- for i&lt;br /&gt;
    elseif cp == &amp;quot;table&amp;quot; then&lt;br /&gt;
        cp = s&lt;br /&gt;
    elseif cp == &amp;quot;number&amp;quot; then&lt;br /&gt;
        cp = { s }&lt;br /&gt;
    else&lt;br /&gt;
        cp = { }&lt;br /&gt;
    end&lt;br /&gt;
    Unicode.merge( uc, all, ask )&lt;br /&gt;
    Unicode.merge( xx, all, &amp;quot;*&amp;quot; )&lt;br /&gt;
    na = #cp&lt;br /&gt;
    nu = #uc&lt;br /&gt;
    nx = #xx&lt;br /&gt;
    for j = 1, na do&lt;br /&gt;
        m = f( uc, nu, cp[ j ] )&lt;br /&gt;
        if m then&lt;br /&gt;
            m = f( xx, nx, m )&lt;br /&gt;
            if m then&lt;br /&gt;
                r = false&lt;br /&gt;
                break -- for j&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end -- for j&lt;br /&gt;
    return r, cp&lt;br /&gt;
end -- Unicode.isScript()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unicode.merge = function ( accumulate, all, ask, append )&lt;br /&gt;
    -- Ensure single list of items&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     accumulate  -- table, with collection to be extended&lt;br /&gt;
    --     all         -- table, with all definitions&lt;br /&gt;
    --     ask         -- string, with requested script code&lt;br /&gt;
    --     append      -- true, if code names to be appended to entries&lt;br /&gt;
    -- The accumulate table may have been extended&lt;br /&gt;
    local g = all[ ask ]&lt;br /&gt;
    if type( g ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
        local codes, s&lt;br /&gt;
        for k, v in pairs( g ) do&lt;br /&gt;
            s = type( v )&lt;br /&gt;
            break    -- for k, v&lt;br /&gt;
        end -- for k, v&lt;br /&gt;
        if s == &amp;quot;string&amp;quot; then&lt;br /&gt;
            for k, v in pairs( g ) do&lt;br /&gt;
                if append then&lt;br /&gt;
                    codes = { ask, v }&lt;br /&gt;
                    table.sort( codes )&lt;br /&gt;
                end&lt;br /&gt;
                fill( accumulate, all[ v ], codes )&lt;br /&gt;
            end -- for k, v&lt;br /&gt;
            Unicode.sort( accumulate )&lt;br /&gt;
        elseif s == &amp;quot;table&amp;quot; then&lt;br /&gt;
            if append then&lt;br /&gt;
                codes = { ask }&lt;br /&gt;
            end&lt;br /&gt;
            fill( accumulate, g, codes )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end -- Unicode.merge()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unicode.romanNumbers = function ( array, at )&lt;br /&gt;
    -- Check for possible roman numbers&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     array  -- table, with elements as sequence tables&lt;br /&gt;
    --     all    -- number, with position within array&lt;br /&gt;
    -- Returns number, which is identical or greater than at, to proceed&lt;br /&gt;
    local r = at&lt;br /&gt;
    local e = array[ r ]&lt;br /&gt;
    if Unicode.RomanN.dig[ e[ 1 ] ]  and&lt;br /&gt;
       r &amp;gt; 1  and&lt;br /&gt;
       Unicode.RomanN.bef[ array[ r - 1 ][ 1 ] ] then&lt;br /&gt;
        local j = r&lt;br /&gt;
        while j &amp;lt; #array do&lt;br /&gt;
            e = array[ j + 1 ]&lt;br /&gt;
            if Unicode.RomanN.dig[ e[ 1 ] ] then&lt;br /&gt;
                j = j + 1&lt;br /&gt;
            else&lt;br /&gt;
                break    -- while j&lt;br /&gt;
            end&lt;br /&gt;
        end    -- while j&lt;br /&gt;
        if j == #array  or&lt;br /&gt;
           Unicode.RomanN.fol[ e[ 1 ] ] then&lt;br /&gt;
            r = j + 1&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- Unicode.romanNumbers()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unicode.showScripts = function ( analysed )&lt;br /&gt;
    -- Retrieve codepoints and assigned script codes for string&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     analysed  -- table, as returned by Unicode.getScripts()&lt;br /&gt;
    -- Returns string, with every codepoint-script identified&lt;br /&gt;
    local r = &amp;quot;&amp;quot;&lt;br /&gt;
    local c, d, k, s&lt;br /&gt;
    for i = 1, #analysed do&lt;br /&gt;
        c = analysed[ i ]&lt;br /&gt;
        k = c[ 1 ]&lt;br /&gt;
        s = string.format( &amp;quot;%X&amp;quot;, k )&lt;br /&gt;
        d = c[ 2 ]&lt;br /&gt;
        if d then&lt;br /&gt;
            if type( d ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
                s = string.format( &amp;quot;%s-%s-%s&amp;quot;,&lt;br /&gt;
                                   s,&lt;br /&gt;
                                   mw.ustring.char( k ),&lt;br /&gt;
                                   d )&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            s = s .. &amp;quot;-????&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        r = string.format( &amp;quot;%s %s&amp;quot;, r, s )&lt;br /&gt;
    end -- for i&lt;br /&gt;
    return r&lt;br /&gt;
end -- Unicode.showScripts()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unicode.sort = function ( apply )&lt;br /&gt;
    -- Sort code ranges&lt;br /&gt;
    --     apply  -- table, with request&lt;br /&gt;
    local function f( a1, a2 )&lt;br /&gt;
              return a1[ 1 ] &amp;lt; a2[ 1 ]&lt;br /&gt;
          end&lt;br /&gt;
    table.sort( apply, f )&lt;br /&gt;
end -- Unicode.sort()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unicode.testScripts = function ( assume, analyse )&lt;br /&gt;
    -- Check whether all chars match script&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     assume   -- string, with expected script code&lt;br /&gt;
    --     analyse  -- string or number or table, with text&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns&lt;br /&gt;
    --         1. number, of chars matching assume&lt;br /&gt;
    --         2. number, of chars violating assume&lt;br /&gt;
    local rA = 0&lt;br /&gt;
    local rX = 0&lt;br /&gt;
    local xx = { }&lt;br /&gt;
    local i  = 1&lt;br /&gt;
    local cp, e, p&lt;br /&gt;
    Unicode.merge( xx, ISO15924.fetch( &amp;quot;unicodes&amp;quot; ), &amp;quot;*&amp;quot; )&lt;br /&gt;
    cp = Unicode.getScripts( xx, analyse, assume )&lt;br /&gt;
    while i &amp;lt;= #cp do&lt;br /&gt;
        e = cp[ i ]&lt;br /&gt;
        p = e[ 2 ]&lt;br /&gt;
        if type( p ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
            if p == assume then&lt;br /&gt;
                rA = rA + 1&lt;br /&gt;
            elseif p == &amp;quot;Latn&amp;quot; then&lt;br /&gt;
                local j = Unicode.romanNumbers( cp, i )&lt;br /&gt;
                if j &amp;gt; i then&lt;br /&gt;
                    i = j&lt;br /&gt;
                    rX = rX - 1&lt;br /&gt;
                end&lt;br /&gt;
                rX = rX + 1&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        i = i + 1&lt;br /&gt;
    end    -- while i&lt;br /&gt;
    return rA, rX&lt;br /&gt;
end -- Unicode.testScripts()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ISO15924.fetch = function ( access, alert )&lt;br /&gt;
    -- Fetch mw.loadData component&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     access  -- table name&lt;br /&gt;
    --     alert   -- true, for throwing error on data problem&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns table&lt;br /&gt;
    local r = ISO15924[ access ]&lt;br /&gt;
    if type( r ) ~= &amp;quot;table&amp;quot; then&lt;br /&gt;
        local ext, s, sub&lt;br /&gt;
        if not ISO15924.config then&lt;br /&gt;
            ISO15924.config = true&lt;br /&gt;
            ISO15924.fetch( &amp;quot;config&amp;quot;, alert )    -- self&lt;br /&gt;
            if ISO15924.config.live then&lt;br /&gt;
                ISO15924.statics = &amp;quot;commons&amp;quot;&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        for i = 1, #ISO15924.Commons do&lt;br /&gt;
            s = ISO15924.Commons[ i ]&lt;br /&gt;
            if s == access then&lt;br /&gt;
                sub = ISO15924.statics&lt;br /&gt;
                break -- for i&lt;br /&gt;
            end&lt;br /&gt;
        end -- for i&lt;br /&gt;
        sub = sub or access&lt;br /&gt;
        ISO15924.loadData = ISO15924.loadData or { }&lt;br /&gt;
        if ISO15924.loadData[ sub ] then&lt;br /&gt;
            ext = ISO15924.loadData[ sub ]&lt;br /&gt;
        else&lt;br /&gt;
            ext = foreignModule( ISO15924.suite,&lt;br /&gt;
                                 false,&lt;br /&gt;
                                 sub,&lt;br /&gt;
                                 ISO15924.item,&lt;br /&gt;
                                 alert )&lt;br /&gt;
            ISO15924.loadData[ sub ] = ext&lt;br /&gt;
        end&lt;br /&gt;
        if type( ext ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
            if type( ext[ access ] ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
               r = ext[ access ]&lt;br /&gt;
            elseif sub == &amp;quot;config&amp;quot; then&lt;br /&gt;
                r = ext&lt;br /&gt;
            else&lt;br /&gt;
                r = { }&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            r = { }&lt;br /&gt;
        end&lt;br /&gt;
        ISO15924[ access ] = r&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- ISO15924.fetch()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ISO15924.getLanguageScript = function ( ask )&lt;br /&gt;
    -- Retrieve primary script for language&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     ask  -- string, with language code&lt;br /&gt;
    -- Returns string, with associated script code&lt;br /&gt;
    local r&lt;br /&gt;
    if type( ask ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
        local s = ask&lt;br /&gt;
        local n = #s&lt;br /&gt;
        if n == 7  or  n == 8 then&lt;br /&gt;
            r = s:match( &amp;quot;^%a%a%a?%-(%a%a%a%a)$&amp;quot; )&lt;br /&gt;
            if r then&lt;br /&gt;
                r = r:sub( 1, 1 ):upper() ..&lt;br /&gt;
                    r:sub( 2 ):lower()&lt;br /&gt;
            end&lt;br /&gt;
        elseif n &amp;gt; 3 then&lt;br /&gt;
            s = s:match( &amp;quot;^(%a%a%a?)%-&amp;quot; )&lt;br /&gt;
        end&lt;br /&gt;
        if not r and s then&lt;br /&gt;
            local written = ISO15924.fetch( &amp;quot;iso639script&amp;quot; )&lt;br /&gt;
            if type( written ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
                r = written[ s:lower() ]&lt;br /&gt;
                if type( r ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
                    r = r[ 1 ]&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r or &amp;quot;Latn&amp;quot;&lt;br /&gt;
end -- ISO15924.getLanguageScript()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ISO15924.getScripts = function ( analyse )&lt;br /&gt;
    -- Retrieve codepoints and assigned script codes&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     analyse  -- string or number or table, with text&lt;br /&gt;
    -- Returns table, with all relations codepoint / scripts&lt;br /&gt;
    local xx = { }&lt;br /&gt;
    Unicode.merge( xx,  ISO15924.fetch( &amp;quot;unicodes&amp;quot; ),  &amp;quot;*&amp;quot; )&lt;br /&gt;
    return Unicode.getScripts( xx, analyse, false )&lt;br /&gt;
end -- ISO15924.getScripts()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ISO15924.isCJK = function ( ask )&lt;br /&gt;
    -- Check whether script is Chinese-Japanese-Korean (CJK)&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     ask  -- string, with language or script code&lt;br /&gt;
    -- Returns true, if CJK&lt;br /&gt;
    return fulfil( ask, &amp;quot;cjk&amp;quot; )&lt;br /&gt;
end -- ISO15924.isCJK()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ISO15924.isRTL = function ( ask )&lt;br /&gt;
    -- Check whether script is right-to-left&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     ask  -- string, with language or script code&lt;br /&gt;
    -- Returns true, if right-to-left&lt;br /&gt;
    return fulfil( ask, &amp;quot;rtl&amp;quot; )&lt;br /&gt;
end -- ISO15924.isRTL()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ISO15924.isScript = function ( assume, analyse )&lt;br /&gt;
    -- Check all chars for expected script code ranges&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     assume   -- string, with expected script code&lt;br /&gt;
    --     analyse  -- string or number or table, with text&lt;br /&gt;
    -- Returns&lt;br /&gt;
    --     1. true, if all chars within&lt;br /&gt;
    --     2. analyse as table&lt;br /&gt;
    return Unicode.isScript( ISO15924.fetch( &amp;quot;unicodes&amp;quot; ),&lt;br /&gt;
                             assume,&lt;br /&gt;
                             analyse )&lt;br /&gt;
end -- ISO15924.isScript()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ISO15924.isTrans = function ( ask, assign, about )&lt;br /&gt;
    -- Check whether valid transcription for context&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     ask     -- string, with transcription key&lt;br /&gt;
    --     assign  -- string, with language or scripting code&lt;br /&gt;
    --     about   -- string or nil, with site scripting code&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns boolean&lt;br /&gt;
    local r = false&lt;br /&gt;
    local t, trans&lt;br /&gt;
    local r, trsl&lt;br /&gt;
    if type( ask ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
        local trans = ISO15924.fetch( &amp;quot;trans&amp;quot; )&lt;br /&gt;
        local t = trans[ assign ]&lt;br /&gt;
        if type( t ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
            for k, v in pairs( t ) do&lt;br /&gt;
                if v == ask then&lt;br /&gt;
                    r = true&lt;br /&gt;
                    break    -- for i&lt;br /&gt;
                end&lt;br /&gt;
            end -- for k, v&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    if not r  and  about == &amp;quot;Latn&amp;quot; then&lt;br /&gt;
        r = ( ask == &amp;quot;BGN-PCGN&amp;quot;  or  ask == &amp;quot;ALA-LC&amp;quot; )&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- ISO15924.isTrans()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ISO15924.scriptName = function ( assigned, alien, add )&lt;br /&gt;
    -- Retrieve script name, hopefully linked&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     assigned  -- string, with script code&lt;br /&gt;
    --     alien     -- string, with language code, or not&lt;br /&gt;
    --     add       -- arbitrary additional information&lt;br /&gt;
    -- Returns string&lt;br /&gt;
    return ISO15924.Text.scriptName( assigned, alien, add )&lt;br /&gt;
end -- ISO15924.scriptName()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ISO15924.showScripts = function ( analyse )&lt;br /&gt;
    -- Retrieve codepoints and assigned script codes for and as string&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     analyse  -- string or number or table, with text&lt;br /&gt;
    -- Returns string, with every codepoint-script identified&lt;br /&gt;
    local xx = { }&lt;br /&gt;
    local cp&lt;br /&gt;
    Unicode.merge( xx, ISO15924.fetch( &amp;quot;unicodes&amp;quot; ), &amp;quot;*&amp;quot; )&lt;br /&gt;
    cp = Unicode.getScripts( xx, analyse, false )&lt;br /&gt;
    return Unicode.showScripts( cp )&lt;br /&gt;
end -- ISO15924.showScripts()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ISO15924.testScripts = function ( assume, analyse )&lt;br /&gt;
    -- Check whether all chars match script&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     assume   -- string, with expected script code&lt;br /&gt;
    --     analyse  -- string or number or table, with text&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns&lt;br /&gt;
    --         1. number, of chars matching assume&lt;br /&gt;
    --         2. number, of chars violating assume&lt;br /&gt;
    return Unicode.testScripts( assume, analyse )&lt;br /&gt;
end -- ISO15924.testScripts()&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 or &amp;quot;wikidata&amp;quot; or &amp;quot;~&amp;quot;&lt;br /&gt;
    --                 or false&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns  string  -- with queried version, also if problem&lt;br /&gt;
    --              false   -- if appropriate&lt;br /&gt;
    -- 2019-10-15&lt;br /&gt;
    local last  = ( atleast == &amp;quot;~&amp;quot; )&lt;br /&gt;
    local since = atleast&lt;br /&gt;
    local r&lt;br /&gt;
    if last  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 entity = mw.wikibase.getEntity( string.format( &amp;quot;Q%d&amp;quot;,&lt;br /&gt;
                                                                 item ) )&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;
                    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;
    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;
p.getLanguageScript = function ( frame )&lt;br /&gt;
    local s = mw.text.trim( frame.args[ 1 ]  or  &amp;quot;&amp;quot; )&lt;br /&gt;
    return ISO15924.getLanguageScript( s )&lt;br /&gt;
end -- p.getLanguageScript&lt;br /&gt;
&lt;br /&gt;
p.isCJK = function ( frame )&lt;br /&gt;
    local s = mw.text.trim( frame.args[ 1 ]  or  &amp;quot;&amp;quot; )&lt;br /&gt;
    return ISO15924.isCJK( s )  and  &amp;quot;1&amp;quot;   or   &amp;quot;&amp;quot;&lt;br /&gt;
end -- p.isCJK()&lt;br /&gt;
&lt;br /&gt;
p.isRTL = function ( frame )&lt;br /&gt;
    local s = mw.text.trim( frame.args[ 1 ]  or  &amp;quot;&amp;quot; )&lt;br /&gt;
    return ISO15924.isRTL( s )  and  &amp;quot;1&amp;quot;   or   &amp;quot;&amp;quot;&lt;br /&gt;
end -- p.isRTL()&lt;br /&gt;
&lt;br /&gt;
p.isScript = function ( frame )&lt;br /&gt;
    local s1 = mw.text.trim( frame.args[ 1 ]  or  &amp;quot;&amp;quot; )&lt;br /&gt;
    local s2 = mw.text.trim( frame.args[ 2 ]  or  &amp;quot;&amp;quot; )&lt;br /&gt;
    local r, cp = ISO15924.isScript( s1, s2 )&lt;br /&gt;
    return r and &amp;quot;1&amp;quot;  or  &amp;quot;&amp;quot;&lt;br /&gt;
end -- p.isScript&lt;br /&gt;
&lt;br /&gt;
p.isTrans = function ( frame )&lt;br /&gt;
    -- Check whether valid transcription for context&lt;br /&gt;
    --     1     -- string, with transcription key&lt;br /&gt;
    --     2     -- string, with language or scripting code&lt;br /&gt;
    --     site  -- string or nil, with site scripting code&lt;br /&gt;
    local s1   = mw.text.trim( frame.args[ 1 ]  or  &amp;quot;&amp;quot; )&lt;br /&gt;
    local s2   = mw.text.trim( frame.args[ 2 ]  or  &amp;quot;&amp;quot; )&lt;br /&gt;
    local site = mw.text.trim( frame.args.site  or  &amp;quot;&amp;quot; )&lt;br /&gt;
    return ISO15924.isTrans( s1, s2, site )  and  &amp;quot;1&amp;quot;   or   &amp;quot;&amp;quot;&lt;br /&gt;
end -- p.isTrans&lt;br /&gt;
&lt;br /&gt;
p.scriptName = function ( frame )&lt;br /&gt;
    local s1    = mw.text.trim( frame.args[ 1 ]  or  &amp;quot;&amp;quot; )&lt;br /&gt;
    local s2    = mw.text.trim( frame.args[ 2 ]  or  &amp;quot;&amp;quot; )&lt;br /&gt;
    local slang = mw.text.trim( frame.args.lang  or  &amp;quot;&amp;quot; )&lt;br /&gt;
    return ISO15924.Text.scriptName( s1, slang, s2 )&lt;br /&gt;
end -- p.scriptName&lt;br /&gt;
&lt;br /&gt;
p.showScripts = function ( frame )&lt;br /&gt;
    local s = frame.args[ 1 ]&lt;br /&gt;
    local r&lt;br /&gt;
    if s then&lt;br /&gt;
        r = ISO15924.showScripts( mw.text.trim( s ) )&lt;br /&gt;
    else&lt;br /&gt;
        r = &amp;quot;&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- p.showScripts&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.ISO15924 = function ()&lt;br /&gt;
    return ISO15924&lt;br /&gt;
end -- p.ISO15924&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>mo&gt;PerfektesChaos</name></author>
		
	</entry>
</feed>