
Verwendung
Das Submodul ist eine Testversion des Moduls Quickbar Land und nicht für den Produktivbetrieb geeignet. Es dient der Weiterentwicklung des Moduls Quickbar Land, damit sich Änderungen nicht auf alle Artikel auswirken, die das Modul benutzen.
![]() | Derzeit arbeitet kein Benutzer an diesem Testmodul. Du kannst es für deine Zwecke benutzen. |
Neu- und Weiterentwicklung des Moduls für die {{Quickbar Land}}.
Testobjekte
Deutschland:
Deutschland | |
Flagge | |
Kurzdaten | |
Hauptstadt | Berlin |
---|---|
Regierungsform | Republik, Bundesstaat, parlamentarische Bundesrepublik, parlamentarische Republik |
Währung | Euro (EUR) |
Fläche | 357.588 km² |
Einwohnerzahl | 84.358.845 (2022) |
Amtssprache | Deutsch |
Strom/Stecker | 230 V, 50 Hz; Schuko/Eurostecker |
Telefonvorwahl | +49 |
Domain | .de |
Zeitzone | MEZ (UTC+1), MESZ (UTC+2) |
{{#invoke:Quickbar Land/Test|qb_land
|id= Q183
|Zeitzone= MEZ (UTC+1), MESZ (UTC+2)
}}
Ägypten:
Ägypten | |
Flagge | |
Kurzdaten | |
Hauptstadt | Kairo |
---|---|
Regierungsform | Republik |
Währung Kurs (25.04.2025)[1] | ägyptisches Pfund 1 EUR = 57,968 EGP 100 EGP = 1,725 EUR |
Fläche | 1.010.408 km² |
Einwohnerzahl | 114.535.772 (2023) |
Amtssprache | Arabisch |
Religion | Islam (haupts. Sunnitischer Islam) 94%, Koptische Christen und andere 6% |
Strom/Stecker | 220 V, 50 Hz; Eurostecker/Schuko |
Telefonvorwahl | +20 |
Domain | .eg, .مصر |
Zeitzone | UTC+2, MEZ+1, MESZ+0 |
{{#invoke:Quickbar Land/Test|qb_land
|id= Q79
|Religion= Islam (haupts. Sunnitischer Islam) 94%, Koptische Christen und andere 6%
|Zeitzone= UTC+2, MEZ+1, MESZ+0
}}
Südafrika:
Südafrika | |
Flagge | |
Kurzdaten | |
Hauptstadt | Pretoria, Bloemfontein, Kapstadt |
---|---|
Regierungsform | parlamentarische Republik, repräsentative Demokratie |
Währung Kurs (04.04.2025)[2] | südafrikanischer Rand 1 EUR = 21,079 ZAR 100 ZAR = 4,744 EUR |
Fläche | 1.221.037 km² |
Einwohnerzahl | 62.027.503 (2022) |
Amtssprache | Englisch, Afrikaans, Süd-Ndebele, Nord-Sotho, Sesotho, Siswati, Xitsonga, Setswana, Tshivenda, IsiXhosa, isiZulu, Südafrikanische Gebärdensprache |
Religion | Christen 68 % (die meisten Weißen und Farbigen), ungefähr 60 % der schwarzen Bev., 2% Muslime, 1,5% Hindus |
Strom/Stecker | 230 V, 50 Hz; Eurostecker/D/M/IEC 60906-1 |
Telefonvorwahl | +27 |
Domain | .za |
Zeitzone | UTC+2, MEZ+1, MESZ+0 |
{{#invoke:Quickbar Land/Test|qb_land
|id= Q258
|Religion= Christen 68 % (die meisten Weißen und Farbigen), ungefähr 60 % der schwarzen Bev., 2% Muslime, 1,5% Hindus
|Zeitzone= UTC+2, MEZ+1, MESZ+0
}}
Demokratische Republik Kongo:
Demokratische Republik Kongo | |
Flagge | |
Kurzdaten | |
Hauptstadt | Kinshasa |
---|---|
Regierungsform | Republik |
Währung | Kongo-Franc (CDF) |
Fläche | 2.344.858 km² |
Einwohnerzahl | 105.789.731 (2023) |
Amtssprache | Französisch |
Strom/Stecker | 220 V, 50 Hz; Eurostecker/D/E |
Telefonvorwahl | +243 |
Domain | .cd |
Zeitzone | MEZ |
{{#invoke:Quickbar Land/Test|qb_land
|id= Q974
|Zeitzone=MEZ
}}
Thaliand: zu Testzwecken vieles manuell.
Thailand · Siam | |
Flagge | |
Kurzdaten | |
Hauptstadt | Krung Thep |
---|---|
Regierungsform | Konstitutionelle Monarchie |
Währung Kurs (04.04.2025)[3] | thailändischer Baht 1 EUR = 37,793 THB 100 THB = 2,646 EUR |
Fläche | 513.120 km² |
Einwohnerzahl | 66.188.503 |
Amtssprache | Thai |
Religion | Buddhismus 95 %, Islam 4 %, Christentum 0,7 %, Hinduismus 0,1%, andere 0,2% |
Strom/Stecker | 220 V; 50 Hz; A/C |
Telefonvorwahl | +66 |
Domain | .th |
Zeitzone | UTC+7 (MEZ+6, MESZ+5) |
{{#invoke:Quickbar Land/Test|qb_land
|id= Q869
|Namen = Thailand '''·''' Siam
|Lage=[[File:LocationThailand.png|300px|class=notpageimage|Lagekarte]]
|Hauptstadt= [[Krung Thep]]
|Staatsform=Konstitutionelle Monarchie
|Fläche= 513.120 km²
|Bevölkerung= 66.188.503
|Amtssprache= Thai
|Religion=Buddhismus 95 %, Islam 4 %, Christentum 0,7 %, Hinduismus 0,1%, andere 0,2%
|Stromnetz= 220 V; 50 Hz
|Stecksysteme = A/C
|Zeitzone= UTC+7 (MEZ+6, MESZ+5)
}}
Kosovo:
Kosovo | |
Flagge | |
Kurzdaten | |
Hauptstadt | Pristina |
---|---|
Regierungsform | parlamentarische Republik |
Fläche | 10.909 km² |
Einwohnerzahl | 1.586.659 (2024) |
Amtssprache | Albanisch, Serbisch |
Strom/Stecker | 230 V, 50 Hz; Schuko |
Telefonvorwahl | +383 |
Domain | |
Zeitzone | MEZ |
{{#invoke:Quickbar Land/Test|qb_land
|id= Q1246
|Zeitzone=MEZ
}}
- Die obige Dokumentation wurde aus der Seite Modul:Quickbar Land/Test/Doku eingefügt. (bearbeiten | Versionsgeschichte) Die Kategorien für dieses Modul sollten in der Dokumentation eingetragen werden. Die Interwiki-Links sollten auf Wikidata eingepflegt werden.
- Liste der Unterseiten
--[=[ Quickbar Land 2023-11-10 ]=] local yesno = require( 'Modul:Yesno' ) local pnumber = require( 'Module:GetNumber' ) local images = require( 'Module:GetImage' ) local items = require( 'Module:GetItem' ) local cfgCurrencies = mw.loadData('Modul:Währung/Länder') local cfgCountries = mw.loadData('Modul:CountryData/Geography') local lang = mw.language.new( 'de' ) -- returns nil, if both values are equal, otherwise the value -- similar to the SQL function nullif() local function nilIf ( value, equalValue ) if ( value == nil ) then return nil elseif ( tostring ( value ) == tostring ( equalValue ) ) then return nil else return value end end -- returns the first value that is not nil -- similar to the SQL function coalesce() local function coalesce ( value1, value2, value3 ) return value1 or value2 or value3 end -- round function, which is not available in Lua local _round = function ( value, precision ) local rescale = math.pow(10, precision or 0); return math.floor(value * rescale + 0.5) / rescale; end -- returns a manually created quickbar row local function createTr ( text, label, trClass ) -- check for valid text -- if there is no text, then display nothing if text == '' then return '' else -- displaying the given info local tr = mw.html.create ( 'tr' ) tr:addClass('voy-qb-item ' .. trClass ) :tag('th') :addClass('voy-qb-item-key') :wikitext( label ) tr:tag('td') :addClass( 'voy-qb-item-value1' ) :wikitext( text ) return tostring ( tr ) end end local function checkMapObject ( id ) local region = require ( 'Modul:Location map data ' .. id ) if ( region ~= nil ) and ( region.data ~= nil ) then region.data['id'] = id return region else return nil end end local qbLand = {} function qbLand.qb_land ( frame ) -- copying and lowering the given parameters local templateArgs = {} for key,value in pairs ( frame.args ) do templateArgs[string.lower(key)] = value end for key,value in pairs ( frame:getParent().args ) do templateArgs[string.lower(key)] = value end -- variables for the whole quickbar content and the categories local display = '' local categories = '' -- contains some site.infos -- needed as fallback for the parameter "Namen" and the location map local page = {} page = mw.title.getCurrentTitle() -- getting or determining (if needed) the wikidata-ID if templateArgs.id == '' then templateArgs.id = nil end local qbID = nilIf ( nilIf ( templateArgs.id, 'self' ), '' ) or mw.wikibase.getEntityIdForCurrentPage() or '' -- getting object name -- uses WD sitelink and the page name as fallback local destinationName if qbID ~= '' then destinationName = coalesce ( mw.wikibase.getSitelink( qbID, 'dewikivoyage' ), page.text, 'Ort') else destinationName = coalesce ( page.text, 'Ort') end -- determining the country -- (not urgently needed, but if someone wants to develop country- specific quickbars) -- getting from Wikidata, if not provided -- if you want to save processing time, you should provide it -- e.g. in country specific infobox tables local qbIso3166 = templateArgs["iso-3166"] or '' local qbIso3166Class = '' if qbIso3166 == '' then if qbID ~= '' then local wdCountry = mw.wikibase.getBestStatements( qbID, 'P17' ) local wdIso3166 = {} if #wdCountry > 0 then -- there where empty values if wdCountry[1].mainsnak.datavalue ~= nil then wdIso3166 = mw.wikibase.getBestStatements( wdCountry[1].mainsnak.datavalue.value["id"], 'P297' ) if #wdIso3166 > 0 then if wdIso3166[1].mainsnak.snaktype == 'value' then qbIso3166 = string.lower(wdIso3166[1].mainsnak.datavalue.value) qbIso3166Class = ' voy-qb-' .. qbIso3166 else qbIso3166Class = '' end else qbIso3166Class = '' end else qbIso3166Class = '' end end end else qbIso3166Class = ' voy-qb-' .. qbIso3166 end -- DEBUG: showing the parameters -- it was just for development -- display = display .. '<br />Parameter:<br />' .. mw.dumpObject(templateArgs) -- starting the quickbar table display = display .. '<table cellspacing="0" class="voy-qb voy-qb-right voy-qb-country' .. qbIso3166Class .. '">' -- heading -- is mandatory, even if you do not provide it, its shown (with the sitename) -- initialising with given heading local qbNamen = coalesce ( templateArgs["namen"], '' ) -- if no heading is provided, get the sitename if qbNamen == '' then qbNamen = destinationName end -- creating the row with the heading local trHeader = mw.html.create ( 'tr' ) trHeader:addClass( 'voy-qb-header' ) trHeader:tag('td') :attr('colspan', 2 ) :wikitext(qbNamen) -- adding it to the quickbar display = display .. tostring ( trHeader ) -- the position map -- taken from Wikidata, if not provided display = display .. images.GetImage().getPositionMapQuickbar ( qbID, nil, nil, coalesce ( templateArgs["lage"], '' ) ) -- creating the row with the flag heading trHeader = mw.html.create ( 'tr' ) trHeader:addClass( 'voy-qb-header voy-qb-header-flag' ) trHeader:tag('td') :attr('colspan', 2 ) :wikitext('Flagge') -- adding it to the quickbar display = display .. tostring ( trHeader ) -- flag -- always taken from Wikidata display = display .. images.GetImage().getEmblemsQuickbar ( qbID, 'F' ) -- creating the row with the info heading trHeader = mw.html.create ( 'tr' ) trHeader:addClass( 'voy-qb-header voy-qb-header-info' ) trHeader:tag('td') :attr('colspan', 2 ) :wikitext('Kurzdaten') -- adding it to the quickbar display = display .. tostring ( trHeader ) -- capital display = display .. items.GetItem().getItemsQuickbar ( qbID, 'P36', coalesce ( templateArgs["hauptstadt"], '') ) -- basic form of government display = display .. items.GetItem().getItemsQuickbar ( qbID, 'P122', coalesce ( templateArgs["staatsform"], '') ) -- currency if cfgCurrencies[qbID] ~= nil then -- getting exchange rate local exchangeRate = 0 local exchangeDate = '' local exchangeSource = '' local exchangeTable = {} -- trying Commons: Data:ECB euro foreign exchange reference rates.tab exchangeTable = mw.ext.data.get( 'ECB euro foreign exchange reference rates.tab' ) for i, entry in pairs ( exchangeTable.data ) do if entry[1] == cfgCurrencies[qbID][4] then exchangeRate = _round ( tonumber ( entry[2] ), 3 ) exchangeDate = entry[3] exchangeSource = exchangeTable.sources break end end -- trying Commons: Data:Xe.com exchange rates.tab if exchangeRate == 0 then exchangeTable = mw.ext.data.get( 'Xe.com exchange rates.tab' ) for i, entry in pairs ( exchangeTable.data ) do if entry[1] == cfgCurrencies[qbID][4] then exchangeRate = _round ( tonumber ( entry[3] ), 3 ) exchangeDate = entry[6] exchangeSource = exchangeTable.sources break end end end if exchangeRate > 0 and cfgCurrencies[qbID][4] ~= 'EUR' then -- formatting exchange rate local exchangeRateText = '<br />' -- first row (EUR > local) exchangeRateText = exchangeRateText .. '1 EUR = ' .. lang:formatNum ( exchangeRate ) .. ' ' .. cfgCurrencies[qbID][4] -- second row (local > EUR) exchangeRateText = exchangeRateText .. '<br />' if exchangeRate > 10000 then exchangeRateText = exchangeRateText .. '100.000 ' .. cfgCurrencies[qbID][4] .. ' = ' .. lang:formatNum ( _round ( 100000 / exchangeRate, 3 ) ) .. ' EUR' elseif exchangeRate > 1000 then exchangeRateText = exchangeRateText .. '10.000 ' .. cfgCurrencies[qbID][4] .. ' = ' .. lang:formatNum ( _round ( 10000 / exchangeRate, 3 ) ) .. ' EUR' elseif exchangeRate > 100 then exchangeRateText = exchangeRateText .. '1.000 ' .. cfgCurrencies[qbID][4] .. ' = ' .. lang:formatNum ( _round ( 1000 / exchangeRate, 3 ) ) .. ' EUR' elseif exchangeRate > 10 then exchangeRateText = exchangeRateText .. '100 ' .. cfgCurrencies[qbID][4] .. ' = ' .. lang:formatNum ( _round ( 100 / exchangeRate, 3 ) ) .. ' EUR' elseif exchangeRate > 1 then exchangeRateText = exchangeRateText .. '10 ' .. cfgCurrencies[qbID][4] .. ' = ' .. lang:formatNum ( _round ( 10 / exchangeRate, 3 ) ) .. ' EUR' else exchangeRateText = exchangeRateText .. '1 ' .. cfgCurrencies[qbID][4] .. ' = ' .. lang:formatNum ( _round ( 1 / exchangeRate, 3 ) ) .. ' EUR' end -- adding the ref-Tag exchangeSource = frame:extensionTag{ name = 'ref', content = '[' .. exchangeSource .. ']' } display = display .. createTr ( cfgCurrencies[qbID][3] .. exchangeRateText, 'Währung<br />Kurs <span class="voy-small">(' .. lang:formatDate ( 'd.m.Y', exchangeDate ) .. ')' .. exchangeSource .. '</span>', 'voy-commons-content voy-qb-item-currency' ) else display = display .. createTr ( cfgCurrencies[qbID][3] .. ' (' .. cfgCurrencies[qbID][4] .. ')', 'Währung', 'voy-qb-item-currency' ) end end -- area display = display .. pnumber.GetNumber().getNumbersWithUnitQuickbar ( qbID, 'P2046', nil, 0, coalesce ( templateArgs["fläche"], '' ) ) -- population display = display .. pnumber.GetNumber().getNumbersWithDateQuickbar ( qbID, 'P1082', coalesce ( templateArgs["bevölkerung"], '' ) ) -- official language display = display .. items.GetItem().getItemsQuickbar ( qbID, 'P37', coalesce ( templateArgs["amtssprache"], ''), nil, ', ' ) -- religion (no wikidata) if coalesce ( templateArgs["religion"], '' ) ~= '' then display = display .. createTr ( templateArgs["religion"], 'Religion', 'voy-qb-item-religion' ) end -- electricity -- getting the Voltage local voltage = coalesce ( nilIf ( templateArgs["stromnetz"], '' ), pnumber.GetNumber().getNumbersWithUnit( qbID, 'P2884' ) , '' ) -- getting the plugs -- when fetching the items as "label only", no categories are provided, they are saved in the second result -- "label only" has zo beused, because the result is used in a link and the categories destroy the link -- normally getItems delivers complete links (if available) with the maintenance categories local plugs, plugsaCat = coalesce ( nilIf ( templateArgs["stecksysteme"], '' ), mw.ustring.gsub ( items.GetItem().getItems( qbID, 'P2853', nil, 'label', '/​' ), 'Stecker%-Typ ', '' ), '' ) if voltage ~= '' or plugs ~= '' then local electricity = voltage local electricityLabel = '' if plugs ~= '' then if voltage ~= '' then electricity = electricity .. ';<br />[[Stromsysteme#Steckertypen|' .. plugs .. ']]' electricityLabel = '[[Stromsysteme|Strom/Stecker]]' categories = categories .. coalesce ( plugsaCat, '' ) else electricity = '[[Stromsysteme#Steckertypen|' .. plugs .. ']]' electricityLabel = '[[Stromsysteme|Stecker]]' end else electricityLabel = '[[Stromsysteme|Stromnetz]]' end display = display .. createTr ( electricity, electricityLabel, 'voy-qb-item-electricity' ) end -- calling code if cfgCountries.countries[qbID] ~= nil then display = display .. createTr ( cfgCountries.countries[qbID].cc, 'Telefonvorwahl', 'voy-qb-item-calling-code' ) end if cfgCountries.adminEntities[qbID] ~= nil then display = display .. createTr ( cfgCountries.adminEntities[qbID].cc, 'Telefonvorwahl', 'voy-qb-item-calling-code' ) end -- top level domain display = display .. items.GetItem().getItemsQuickbar ( qbID, 'P78', nil, nil, ', ' ) -- timezone (no wikidata, for several reasons discussed in community) if coalesce ( templateArgs["zeitzone"], '' ) ~= '' then display = display .. createTr ( templateArgs["zeitzone"], 'Zeitzone', 'voy-qb-item-time-zone' ) end -- finishing the HTML table display = display .. '</table>' return display .. categories end return qbLand