Module:Assemble multilingual message

-- THIS IS BETA SOFTWARE. USE CAREFULLY AND TEST EXTENSIVELY.

local p = {}

function p.assembleMessage(frame) -- This function takes existing translations for a given page       translated using the translate extension and puts them together to        generate the wikicode ready to be delivered by [Global message delivery]

-- Initialize the message's static content

local message = ' ' -- Hide nowiki tags from the preprocessor message = mw.ustring.gsub ( message, ' %s*(.-)%s* ', 'DUMMY%0ENDDUMMY' ) -- Preprocess to make work --message = frame:preprocess( message ) -- Restore nowiki tags now that we've preprocessed message = mw.ustring.gsub ( message, 'DUMMY%s*(.-)%s*ENDDUMMY', ' %0 ' ) -- We're done

return message

end

return p