Nicht angemeldeter Benutzer - Bearbeiten von Seiten ist nur als angemeldeter Benutzer möglich.
Änderungen
Zur Navigation springen
Zur Suche springen
Zeile 1:
Zeile 1:
− +
−
−
−
− -- local globals
− local Frame
Zeile 232:
Zeile 227:
− +
− +
− Frame = mw.getCurrentFrame() +
+
+
+
− frame = Frame
− +
+
Zeile 264:
Zeile 262:
− +
− +
Zeile 467:
Zeile 465:
+
− local s = Multilingual.getBase( ask )
Zeile 497:
Zeile 495:
− +
− +
+
− +
− local r = true+
− if cnf then+
− local s = string.format( " %s ", ask:lower() )+
− if type( cnf.stopMinusculization ) == "string"+
− and cnf.stopMinusculization:find( s, 1, true ) then+
− r = false+
− end
− if r and type( cnf.seekMinusculization ) == "string"
− and cnf.seekMinusculization:find( s, 1, true )
− and type( cnf.scanMinusculization ) == "string" then
− local scan = ask:gsub( "[%(%)]", " " ) .. " "
− if not cnf.scanMinusculization:find( scan ) then
+
+
+
+
+
+
+
+
+
Zeile 531:
Zeile 533:
+
− local s = Multilingual.getBase( ask )
Zeile 558:
Zeile 560:
− +
− +
− Frame = mw.getCurrentFrame() +
− +
− frame = Frame+
+
− +
+
Modul:Multilingual (Quelltext anzeigen)
Version vom 26. November 2017, 10:11 Uhr
, 10:11, 26. Nov. 20172017-11-25
local Multilingual = { suite = "Multilingual",
local Multilingual = { suite = "Multilingual",
serial = "2017-11-24" }
serial = "2017-11-25" }
if cnf and
if cnf and
type( cnf.getLink ) == "function" then
type( cnf.getLink ) == "function" then
if not frame then
if not Multilingual.frame then
if not Frame then
if frame then
Multilingual.frame = frame
else
Multilingual.frame
= mw.getCurrentFrame()
end
end
end
end
slot = cnf.getLink( slang, frame )
slot = cnf.getLink( slang,
Multilingual.frame )
if slot then
if slot then
local wlink = fetch( "WLink" )
local wlink = fetch( "WLink" )
.. mw.ustring.sub( r, 2 )
.. mw.ustring.sub( r, 2 )
elseif alter == "d" then
elseif alter == "d" then
if Multilingual.isMinusculable( slang or "" ) then
if Multilingual.isMinusculable( slang, r ) then
r = mw.ustring.lower( r )
r = mw.ustring.lower( r )
end
end
elseif alter == "m" then
elseif alter == "m" then
if Multilingual.isMinusculable( slang or "" ) then
if Multilingual.isMinusculable( slang, r ) then
r = mw.ustring.lower( mw.ustring.sub( r, 1, 1 ) )
r = mw.ustring.lower( mw.ustring.sub( r, 1, 1 ) )
.. mw.ustring.sub( r, 2 )
.. mw.ustring.sub( r, 2 )
-- Postcondition:
-- Postcondition:
-- Returns boolean
-- Returns boolean
local s = Multilingual.getBase( ask )
local r
local r
if s then
if s then
r = mw.language.isKnownLanguageTag( s )
r = mw.language.isKnownLanguageTag( s )
Multilingual.isMinusculable = function ( ask )
Multilingual.isMinusculable = function ( ask, assigned )
-- Could this language name become downcased?
-- Could this language name become downcased?
-- Precondition:
-- Precondition:
-- ask -- language name
-- ask -- language code, or nil
-- assigned -- language name, or nil
-- Postcondition:
-- Postcondition:
-- Returns boolean
-- Returns boolean
local cnf = fetch( "Multilingual/config", true )
local r = true
if ask then
local cnf = fetch( "Multilingual/config", true )
if cnf then
local s = string.format( " %s ", ask:lower() )
if type( cnf.stopMinusculization ) == "string"
and cnf.stopMinusculization:find( s, 1, true ) then
r = false
r = false
end
if r and assigned
and type( cnf.seekMinusculization ) == "string"
and cnf.seekMinusculization:find( s, 1, true )
and type( cnf.scanMinusculization ) == "string" then
local scan = assigned:gsub( "[%(%)]", " " ) .. " "
if not cnf.scanMinusculization:find( scan ) then
r = false
end
end
end
end
end
-- Postcondition:
-- Postcondition:
-- Returns boolean
-- Returns boolean
local s = Multilingual.getBase( ask )
local r
local r
if s then
if s then
local support = [=[ de als bar dsb frr gsw hsb ksh |
local support = [=[ de als bar dsb frr gsw hsb ksh |
-- Returns string with appropriate code
-- Returns string with appropriate code
local r, slang, support
local r, slang, support
if not frame then
if not Multilingual.frame then
if not Frame then
if frame then
Multilingual.frame = frame
end
else
Multilingual.frame = mw.getCurrentFrame()
end
end
end
slang = frame:callParserFunction( "int", "lang" ):lower()
slang = Multilingual.frame:callParserFunction( "int",
"lang" ):lower()
if type( accept ) == "string" then
if type( accept ) == "string" then
support = accept:lower() .. " "
support = accept:lower() .. " "