<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://star-citizen.wiki/index.php?action=history&amp;feed=atom&amp;title=Modul%3ALocalized</id>
	<title>Modul:Localized - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://star-citizen.wiki/index.php?action=history&amp;feed=atom&amp;title=Modul%3ALocalized"/>
	<link rel="alternate" type="text/html" href="https://star-citizen.wiki/index.php?title=Modul:Localized&amp;action=history"/>
	<updated>2026-05-04T04:14:50Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Star Citizen Wiki</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://star-citizen.wiki/index.php?title=Modul:Localized&amp;diff=17946&amp;oldid=prev</id>
		<title>imported&gt;FoXFTW am 26. August 2022 um 07:03 Uhr</title>
		<link rel="alternate" type="text/html" href="https://star-citizen.wiki/index.php?title=Modul:Localized&amp;diff=17946&amp;oldid=prev"/>
		<updated>2022-08-26T07:03:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local Localized = {}&lt;br /&gt;
&lt;br /&gt;
local metatable = {}&lt;br /&gt;
local methodtable = {}&lt;br /&gt;
&lt;br /&gt;
metatable.__index = methodtable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--- Returns the main title without a language code&lt;br /&gt;
--- E.g. Title &amp;#039;Xyz Boots Grey/Black/en&amp;#039; returns &amp;#039;Xyz Boots Grey/Black&amp;#039;&lt;br /&gt;
---&lt;br /&gt;
--- @param title string&lt;br /&gt;
function methodtable.getMainTitle( self, title )&lt;br /&gt;
    local titleparts = mw.text.split( title, &amp;#039;/&amp;#039; )&lt;br /&gt;
    local subpage = titleparts[#titleparts]&lt;br /&gt;
&lt;br /&gt;
    -- We are on a language subpage&lt;br /&gt;
    if self.translation.checkLanguage( subpage, false ) ~= false then&lt;br /&gt;
        table.remove( titleparts, #titleparts )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return table.concat( titleparts, &amp;#039;/&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--- Return the localized description from SMW&lt;br /&gt;
---&lt;br /&gt;
--- @return string&lt;br /&gt;
function methodtable.getDescription( self )&lt;br /&gt;
	local title = mw.title.getCurrentTitle()&lt;br /&gt;
    local page = self:getMainTitle( self.args[1] or self.args[ &amp;#039;Titel&amp;#039; ] or title.fullText )&lt;br /&gt;
&lt;br /&gt;
    local data = mw.smw.getQueryResult(&amp;#039;[[&amp;#039; .. page .. &amp;#039;]]|?Beschreibung=desc|+lang=&amp;#039; .. self.translation._getLanguageSubpage( title ) )&lt;br /&gt;
&lt;br /&gt;
    if type( data ) == &amp;#039;table&amp;#039; and type( data[ &amp;#039;results&amp;#039; ] ) == &amp;#039;table&amp;#039; then&lt;br /&gt;
    	if type( data[&amp;#039;results&amp;#039;][1] ) == &amp;#039;table&amp;#039; then&lt;br /&gt;
        	return data[&amp;#039;results&amp;#039;][1][&amp;#039;printouts&amp;#039;][&amp;#039;desc&amp;#039;][1] or nil&lt;br /&gt;
    	end&lt;br /&gt;
&lt;br /&gt;
    	return nil&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--- Returns true if the current page is a language sub-page&lt;br /&gt;
---&lt;br /&gt;
--- @param title string&lt;br /&gt;
function methodtable.isLanguagePage( self, title )&lt;br /&gt;
    local titleparts = mw.text.split( title, &amp;#039;/&amp;#039; )&lt;br /&gt;
    local subpage = titleparts[#titleparts]&lt;br /&gt;
&lt;br /&gt;
    return self.translation.checkLanguage( subpage, false ) ~= false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- New Instance&lt;br /&gt;
--- Library entrance&lt;br /&gt;
function Localized.new( self, frame )&lt;br /&gt;
    local args = {}&lt;br /&gt;
    if frame then&lt;br /&gt;
        args = frame:getParent().args&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local instance = {&lt;br /&gt;
        args = args,&lt;br /&gt;
        translation = require( &amp;#039;Module:Template translation&amp;#039; )&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    setmetatable( instance, metatable )&lt;br /&gt;
&lt;br /&gt;
    return instance&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--- Template entry&lt;br /&gt;
function Localized.getDescription( frame )&lt;br /&gt;
    local instance = Localized:new()&lt;br /&gt;
&lt;br /&gt;
    return instance:getDescription()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--- Returns the main title for the current page&lt;br /&gt;
function Localized.getMainTitle( frame )&lt;br /&gt;
    local instance = Localized:new()&lt;br /&gt;
&lt;br /&gt;
    return instance:getMainTitle( mw.title.getCurrentTitle().fullText )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--- Returns true if the current page is a language sub-page&lt;br /&gt;
function Localized.isLanguagePage( frame )&lt;br /&gt;
    local instance = Localized:new()&lt;br /&gt;
&lt;br /&gt;
    return instance:isLanguagePage( mw.title.getCurrentTitle().fullText )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
return Localized&lt;/div&gt;</summary>
		<author><name>imported&gt;FoXFTW</name></author>
	</entry>
</feed>