<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl">
	<id>http://4strona.duckdns.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Modu%C5%82%3AAssemble_multilingual_message</id>
	<title>Moduł:Assemble multilingual message - Historia wersji</title>
	<link rel="self" type="application/atom+xml" href="http://4strona.duckdns.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Modu%C5%82%3AAssemble_multilingual_message"/>
	<link rel="alternate" type="text/html" href="http://4strona.duckdns.org/wiki/index.php?title=Modu%C5%82:Assemble_multilingual_message&amp;action=history"/>
	<updated>2026-07-30T14:05:45Z</updated>
	<subtitle>Historia wersji tej strony wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>http://4strona.duckdns.org/wiki/index.php?title=Modu%C5%82:Assemble_multilingual_message&amp;diff=49&amp;oldid=prev</id>
		<title>Fuhrer: 1 wersja</title>
		<link rel="alternate" type="text/html" href="http://4strona.duckdns.org/wiki/index.php?title=Modu%C5%82:Assemble_multilingual_message&amp;diff=49&amp;oldid=prev"/>
		<updated>2026-07-24T10:03:56Z</updated>

		<summary type="html">&lt;p&gt;1 wersja&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;pl&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← poprzednia wersja&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Wersja z 10:03, 24 lip 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;pl&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Brak różnic)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key 3strona_wiki:diff:1.41:old-48:rev-49 --&gt;
&lt;/table&gt;</summary>
		<author><name>Fuhrer</name></author>
	</entry>
	<entry>
		<id>http://4strona.duckdns.org/wiki/index.php?title=Modu%C5%82:Assemble_multilingual_message&amp;diff=48&amp;oldid=prev</id>
		<title>mediawiki&gt;Quiddity (WMF): try duplicating the 1 difference between this and meta&#039;s version...</title>
		<link rel="alternate" type="text/html" href="http://4strona.duckdns.org/wiki/index.php?title=Modu%C5%82:Assemble_multilingual_message&amp;diff=48&amp;oldid=prev"/>
		<updated>2022-09-21T16:11:03Z</updated>

		<summary type="html">&lt;p&gt;try duplicating the 1 difference between this and meta&amp;#039;s version...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nowa strona&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- THIS IS BETA SOFTWARE. USE CAREFULLY AND TEST EXTENSIVELY.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function p.assembleMessage(frame)&lt;br /&gt;
     --[[ This function takes existing translations for a given page&lt;br /&gt;
        translated using the translate extension and puts them together to&lt;br /&gt;
        generate the wikicode ready to be delivered by [Global message delivery]&lt;br /&gt;
    ]]&lt;br /&gt;
&lt;br /&gt;
    -- Initialize the message&amp;#039;s static content&lt;br /&gt;
&lt;br /&gt;
    local message = &amp;#039;&amp;lt;pre&amp;gt;{{subst:#switch:{{subst:PAGELANGUAGE}}&amp;#039;&lt;br /&gt;
&lt;br /&gt;
    --[[ Build the list of language codes for which there is a translation,&lt;br /&gt;
        and remove English if it was mistakenly added since we already include&lt;br /&gt;
        it as default.&lt;br /&gt;
        We can&amp;#039;t automatically list all available translations of the issue, so&lt;br /&gt;
        we need to input them manually as part of the module&amp;#039;s call.&lt;br /&gt;
    ]]&lt;br /&gt;
    &lt;br /&gt;
    translations = {}&lt;br /&gt;
    &lt;br /&gt;
    for key, value in pairs( frame.args ) do&lt;br /&gt;
        if ( mw.language.isKnownLanguageTag( value ) and value ~= &amp;#039;en&amp;#039; )&lt;br /&gt;
        then&lt;br /&gt;
            translations[value] = value&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Add English as default&lt;br /&gt;
    &lt;br /&gt;
    translations[&amp;#039;#default&amp;#039;] = &amp;#039;en&amp;#039;&lt;br /&gt;
&lt;br /&gt;
    -- Loop through the languages to assemble the available translations&lt;br /&gt;
&lt;br /&gt;
    for switchKey, langCode in pairs( translations ) do&lt;br /&gt;
        &lt;br /&gt;
        --[[ TODO: add existence check of the translation in case of human&lt;br /&gt;
            error. Ignore the incorrect language code and give warning.&lt;br /&gt;
        ]]&lt;br /&gt;
        &lt;br /&gt;
        -- Add new switch key, and language and directionality metadata&lt;br /&gt;
        &lt;br /&gt;
        local direction = mw.language.new( langCode ):getDir()&lt;br /&gt;
        &lt;br /&gt;
        --[[ TODO: add switch keys for languages that have a fallback language&lt;br /&gt;
            for which we do have a translation, instead of English.&lt;br /&gt;
        ]]&lt;br /&gt;
    &lt;br /&gt;
        message = message .. &amp;#039;|&amp;#039; .. switchKey .. &amp;#039;=&amp;lt;div class=&amp;quot;plainlinks mw-content-&amp;#039; .. direction .. &amp;#039;&amp;quot; lang=&amp;quot;&amp;#039; .. langCode .. &amp;#039;&amp;quot; dir=&amp;quot;&amp;#039; .. direction .. &amp;#039;&amp;quot;&amp;gt;&amp;#039;&lt;br /&gt;
        &lt;br /&gt;
        -- Get the translation&amp;#039;s content&lt;br /&gt;
        &lt;br /&gt;
        local page = frame.args[&amp;#039;page&amp;#039;]&lt;br /&gt;
        &lt;br /&gt;
        local content = mw.title.new( page .. &amp;#039;/&amp;#039; .. langCode ):getContent()&lt;br /&gt;
        &lt;br /&gt;
        --[[ Clean up stuff we don&amp;#039;t want to include (headers, footers, etc.)&lt;br /&gt;
            There&amp;#039;s probably a cleaner way to do this but for now it&amp;#039;ll work.&lt;br /&gt;
            TODO: add error checks.&lt;br /&gt;
        ]]&lt;br /&gt;
    &lt;br /&gt;
        local startSection, startIndex = mw.ustring.find( content, &amp;#039;&amp;lt;section begin=&amp;quot;&amp;#039; .. frame.args[&amp;#039;marker&amp;#039;] .. &amp;#039;&amp;quot;/&amp;gt;&amp;#039;, 1, true )&lt;br /&gt;
        local endIndex = mw.ustring.find( content, &amp;#039;&amp;lt;section end=&amp;quot;&amp;#039; .. frame.args[&amp;#039;marker&amp;#039;] .. &amp;#039;&amp;quot;/&amp;gt;&amp;#039;, 1, true )&lt;br /&gt;
    &lt;br /&gt;
        content = mw.ustring.sub( content, startIndex +1 , endIndex -1 )&lt;br /&gt;
        &lt;br /&gt;
        content = mw.ustring.gsub( content, &amp;#039;{{int|&amp;#039;, &amp;#039;{{int|lang=&amp;#039; .. langCode .. &amp;#039;|&amp;#039; )&lt;br /&gt;
        &lt;br /&gt;
        message = message .. content .. &amp;#039;&amp;lt;/div&amp;gt;&amp;#039;&lt;br /&gt;
        &lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Add footer static content&lt;br /&gt;
    &lt;br /&gt;
    message = message .. &amp;#039;}} ~~~~~&amp;lt;/pre&amp;gt;&amp;#039;&lt;br /&gt;
    &lt;br /&gt;
    -- Hide nowiki tags from the preprocessor&lt;br /&gt;
    &lt;br /&gt;
    message = mw.ustring.gsub ( message, &amp;#039;&amp;lt;nowiki&amp;gt;(.-)&amp;lt;/nowiki&amp;gt;&amp;#039;, &amp;#039;&amp;amp;lt;nowiki&amp;amp;gt;%1&amp;amp;lt;/nowiki&amp;amp;gt;&amp;#039; )&lt;br /&gt;
    &lt;br /&gt;
    -- Preprocess to make &amp;lt;pre&amp;gt; work&lt;br /&gt;
    &lt;br /&gt;
    message = frame:preprocess( message )&lt;br /&gt;
    &lt;br /&gt;
    -- We&amp;#039;re done&lt;br /&gt;
&lt;br /&gt;
    return message&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>mediawiki&gt;Quiddity (WMF)</name></author>
	</entry>
</feed>