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 63:
Zeile 63:
− +
+
Zeile 72:
Zeile 73:
− +
+
+
+
+
+
+
Zeile 701:
Zeile 708:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Zeile 819:
Zeile 859:
− return Multilingual.fair( frame.args[ 1 ] ) or "" +
+
Zeile 828:
Zeile 869:
− +
− +
+
Zeile 837:
Zeile 879:
− return Multilingual.findCode( frame.args[ 1 ] ) or "" +
+
Zeile 888:
Zeile 931:
− return Multilingual.getBase( frame.args[ 1 ] ) or "" +
+
Zeile 900:
Zeile 944:
+
Zeile 905:
Zeile 950:
− +
Zeile 915:
Zeile 960:
− return Multilingual.getScriptName( frame.args[ 1 ] or "????", +
− false,+
− frame.args[ 2 ] )+
+
+
+
Zeile 968:
Zeile 1.016:
− +
− frame.args[ 1 ] )+
Zeile 978:
Zeile 1.026:
− +
− frame.args[ 1 ] )+
Zeile 985:
Zeile 1.033:
− +
− +
− +
− +
− +
− +
+
+
+
+
Zeile 997:
Zeile 1.049:
− return Multilingual.userLang( frame.args[ 1 ], frame )+
+
Modul:Multilingual (Quelltext anzeigen)
Version vom 27. Dezember 2018, 16:28 Uhr
, 16:28, 27. Dez. 20182018-12-27
local Multilingual = { suite = "Multilingual",
local Multilingual = { suite = "Multilingual",
serial = "2018-12-25",
serial = "2018-12-27",
item = 47541920 }
item = 47541920 }
local User = { sniffer = "publishchanges" }
local User = { sniffer = "publishchanges" }
-- access -- module title
-- access -- module title
-- allow -- permit non-existence
-- allow -- permit non-existence
-- ahead -- name of startup procedure, if not access
-- ahead -- name of startup procedure, if not access;
-- false for mw.loadData
-- Postcondition:
-- Postcondition:
-- Returns table or false, with library
-- Returns table or false, with library
if Multilingual.ext[ access ] == false then
if Multilingual.ext[ access ] == false then
elseif not Multilingual.ext[ access ] then
elseif not Multilingual.ext[ access ] then
local lucky, got = pcall( require, "Module:" .. access )
local src = "Module:" .. access
local lucky, got
if ahead == false then
lucky, got = pcall( mw.loadData, src )
else
lucky, got = pcall( require, src )
end
Multilingual.ext[ access ] = false
Multilingual.ext[ access ] = false
if type( got ) == "table" then
if type( got ) == "table" then
return r
return r
end -- Multilingual.isMinusculable()
end -- Multilingual.isMinusculable()
Multilingual.isTrans = function ( ask, assign, about )
-- Check whether valid transcription for context
-- ask -- string, with transcription key
-- assign -- string, with language or scripting code
-- about -- string or nil, with site scripting code
-- Returns boolean
local r = false
local t
if type( Multilingual.trans ) ~= "table" then
t = fetch( "Multilingual/scripts", true, false )
if type( t ) == "table" then
Multilingual.trans = t.trans or { }
else
Multilingual.trans = { }
end
end
t = Multilingual.trans[ assign ]
if type( t ) == "table" then
for k, v in pairs( t ) do
if v == ask then
r = true
break -- for i
end
end -- for k, v
end
if not r and about == "Latn" then
r = ( ask == "BGN-PCGN" or ask == "ALA-LC" )
end
return r
end -- Multilingual.isTrans()
-- Format language code
-- Format language code
-- 1 -- language code
-- 1 -- language code
local s = mw.text.trim( frame.args[ 1 ] or "" )
return Multilingual.fair( s ) or ""
end -- p.fair
end -- p.fair
-- 1 -- language version specifier to be supported
-- 1 -- language version specifier to be supported
-- 2 -- language specifier of a possible replacement
-- 2 -- language specifier of a possible replacement
local r = Multilingual.fallback( frame.args[ 1 ], frame.args[ 2 ] )
local s1 = mw.text.trim( frame.args[ 1 ] or "" )
return r and "1" or ""
local s2 = mw.text.trim( frame.args[ 2 ] or "" )
return Multilingual.fallback( s1, s2 ) and "1" or ""
end -- p.fallback
end -- p.fallback
-- Retrieve language code from language name
-- Retrieve language code from language name
-- 1 -- name in current project language
-- 1 -- name in current project language
local s = mw.text.trim( frame.args[ 1 ] or "" )
return Multilingual.findCode( s ) or ""
end -- p.findCode
end -- p.findCode
-- Retrieve base language from possibly combined ISO language code
-- Retrieve base language from possibly combined ISO language code
-- 1 -- code
-- 1 -- code
local s = mw.text.trim( frame.args[ 1 ] or "" )
return Multilingual.getBase( s ) or ""
end -- p.getBase
end -- p.getBase
-- * -- native
-- * -- native
-- any valid code
-- any valid code
local s = mw.text.trim( frame.args[ 1 ] or "" )
local slang = frame.args[ 2 ]
local slang = frame.args[ 2 ]
local r
local r
slang = mw.text.trim( slang )
slang = mw.text.trim( slang )
end
end
r = Multilingual.getName( frame.args[ 1 ], slang )
r = Multilingual.getName( s, slang )
return r or ""
return r or ""
end -- p.getName
end -- p.getName
-- 1 -- code
-- 1 -- code
-- 2 -- optional additional key
-- 2 -- optional additional key
local s1 = mw.text.trim( frame.args[ 1 ] or "????" )
local s2 = frame.args[ 2 ]
if s2 then
s2 = mw.text.trim( s2 )
end
return Multilingual.getScriptName( s1, false, s2 )
end -- p.getScriptName
end -- p.getScriptName
-- Could this be an ISO language code?
-- Could this be an ISO language code?
-- 1 -- code
-- 1 -- code
local lucky, r = pcall( Multilingual.isLang,
local s = mw.text.trim( frame.args[ 1 ] or "" )
local lucky, r = pcall( Multilingual.isLang, s )
return r and "1" or ""
return r and "1" or ""
end -- p.isLang
end -- p.isLang
-- Could this be a Wiki language version?
-- Could this be a Wiki language version?
-- 1 -- code
-- 1 -- code
local lucky, r = pcall( Multilingual.isLangWiki,
local s = mw.text.trim( frame.args[ 1 ] or "" )
local lucky, r = pcall( Multilingual.isLangWiki, s )
return r and "1" or ""
return r and "1" or ""
end -- p.isLangWiki
end -- p.isLangWiki
p.kannDeutsch = function ( frame )
p.isTrans = function ( frame )
-- Kann man mit diesem Sprachcode deutsch verstehen?
-- Check whether valid transcription for context
-- 1 -- code
-- 1 -- string, with transcription key
local r = Multilingual.fallback( frame.args[ 1 ], "de" )
-- 2 -- string, with language or scripting code
return r and "1" or ""
-- site -- string or nil, with site scripting code
end -- p.kannDeutsch
local s1 = mw.text.trim( frame.args[ 1 ] or "" )
local s2 = mw.text.trim( frame.args[ 2 ] or "" )
local site = mw.text.trim( frame.args.site or "" )
return Multilingual.isTrans( s1, s2, site ) and "1" or ""
end -- p.isTrans
-- Which language does the current user prefer?
-- Which language does the current user prefer?
-- 1 -- space separated list of available ISO 639 codes
-- 1 -- space separated list of available ISO 639 codes
local s = mw.text.trim( frame.args[ 1 ] or "" )
return Multilingual.userLang( s, frame )
end -- p.userLang
end -- p.userLang