Module:Set gallery/functions

--   ->  F                       //  ; -- -- Start: -- local F = {};

-- Get localized names: function F.localized_name( name, language ) if not mw.smw then --  If not available, return. return '( mw.smw module not found )'; end local result = mw.smw.ask{  ..name.. , '?' ..language.. ' name=', limit = 1, mainlabel = '-' }; -- Process SMW resutlt: if result == nil or result == '' then return nil; -- No result found. end return result[1][1];   --  First entry. end

-- Link set and card names: function F.link( name ) local nameCard_strip = mw.ustring.gsub( name, '#', '' );   --  Strip «#». local name_noDab = name; if not(name:match('%(2011%)') or name:match('%(series%)')) then -- Don't remove «(2011)» nor «(series)». name_noDab = mw.text.split( name, ' %(' )[1];  --  Remove dab text.    end    return ('%s'):format( nameCard_strip, name_noDab ); end

--- -- Categories: function F._categories( namespace, region, edition ) local categories = (''..'Category:%s %s'):format( region, namespace ); if edition then categories = categories..(''..'Category:%s %s'):format( edition, namespace ); end return categories; end

-- -- Build page header: function f._header( name, name_local, medium, region, edition, notEnglish, italics ) -- TODO return ''; end

return F;