Nicht angemeldeter Benutzer - Bearbeiten von Seiten ist nur als angemeldeter Benutzer möglich.
Änderungen
Zur Navigation springen
Zur Suche springen
Zeile 1:
Zeile 1:
− +
Zeile 102:
Zeile 102:
+
− +
+
Zeile 624:
Zeile 626:
+
− +
+
Zeile 638:
Zeile 642:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Zeile 746:
Zeile 780:
+
− +
+
Zeile 780:
Zeile 816:
− +
+
Zeile 828:
Zeile 865:
− else +
+
+
− +
Zeile 847:
Zeile 886:
− +
− +
− +
2019-05-22
local Multilingual = { suite = "Multilingual",
local Multilingual = { suite = "Multilingual",
serial = "2019-03-01",
serial = "2019-05-22",
item = 47541920 }
item = 47541920 }
local User = { sniffer = "showpreview" }
local User = { sniffer = "showpreview" }
local function fill( access, alien, frame )
local function fill( access, alien, frame )
-- Expand language name template
-- Expand language name template
-- Precondition:
-- access -- string, with language code
-- access -- string, with language code
-- alien -- language code for which to be generated
-- alien -- language code for which to be generated
-- frame -- frame, if available
-- frame -- frame, if available
-- Returns string
-- Postcondition:
-- Returns string
local template = Multilingual.tmplLang
local template = Multilingual.tmplLang
local r
local r
Multilingual.getScriptName = function ( assigned, alien, add )
Multilingual.getScriptName = function ( assigned, alien, add )
-- Retrieve script name, hopefully linked
-- Retrieve script name, hopefully linked
-- Precondition:
-- assigned -- string, with ISO 15924 script code
-- assigned -- string, with ISO 15924 script code
-- alien -- string, with ISO language code, or not
-- alien -- string, with ISO language code, or not
-- add -- arbitrary additional information
-- add -- arbitrary additional information
-- Returns string
-- Postcondition:
-- Returns string
local r = assigned
local r = assigned
local src = "Multilingual/scripting"
local src = "Multilingual/scripting"
return r
return r
end -- Multilingual.getScriptName()
end -- Multilingual.getScriptName()
Multilingual.i18n = function ( available, alt, frame )
-- Select translatable message
-- Precondition:
-- available -- table, with mapping language code ./. text
-- alt -- string|nil|false, with fallback
-- frame -- frame, if available
-- Returns string|nil|false
local r
if type( available ) == "table" then
local codes = { }
for k, v in pairs( available ) do
if type( k ) == "string" and
type( v ) == "string" then
table.insert( codes, mw.text.trim( k:lower() ) )
end
end -- for k, v
r = available[ Multilingual.userLang( codes, frame ) ]
end
if not r and type( alt ) == "string" then
r = mw.text.trim( alt )
end
if r == "" then
r = false
else
end
return r
end -- Multilingual.i18n()
Multilingual.isTrans = function ( ask, assign, about )
Multilingual.isTrans = function ( ask, assign, about )
-- Check whether valid transcription for context
-- Check whether valid transcription for context
-- Precondition:
-- ask -- string, with transcription key
-- ask -- string, with transcription key
-- assign -- string, with language or scripting code
-- assign -- string, with language or scripting code
-- about -- string or nil, with site scripting code
-- about -- string or nil, with site scripting code
-- Returns boolean
-- Postcondition:
-- Returns boolean
local r = false
local r = false
local t
local t
-- Try to support user language by application
-- Try to support user language by application
-- Precondition:
-- Precondition:
-- accept -- space separated list of available ISO 639 codes
-- accept -- string or table
-- space separated list of available ISO 639 codes
-- Default: project language, or English
-- Default: project language, or English
-- frame -- frame, if available
-- frame -- frame, if available
if feasible( "en", codes ) then
if feasible( "en", codes ) then
r = "en"
r = "en"
elseif #codes > 1 and
codes[ 1 ] and
codes[ 1 ]~= "" then
r = codes[ 1 ]
r = codes[ 1 ]
end
end
end
end
end
end
return r
return r or favorite() or "en"
end -- Multilingual.userLang()
end -- Multilingual.userLang()
Multilingual.failsafe = function ( assert )
Multilingual.failsafe = function ( atleast )
-- Retrieve versioning and check for compliance
-- Retrieve versioning and check for compliance
-- Precondition:
-- Precondition:
-- assert -- string, with required version or "wikidata",
-- atleast -- string, with required version or "wikidata",
-- or false
-- or false
-- Postcondition:
-- Postcondition:
-- Returns string with appropriate version, or false
-- Returns string with appropriate version, or false
local since = assert
local since = atleast
local r
local r
if since == "wikidata" then
if since == "wikidata" then