User:Forcing/Software

local languages = require("Module:Language/data") local p = {} FEATURES = { -- Wikipedia:Foundation yes/no parameters to description strings (used t…

local languages = require("Module:Language/data")

local p = {}

FEATURES = { -- Wikipedia:Foundation yes/no parameters to description strings (used to build the category names)
	sendPosition = 'send your position',
	uploadWikiData = 'upload changes to Wikipedia',
	tracking = 'record User:Forcing tracks',
}

-- debug with e.g. =p.featureCategories(nil, {platform='foo;bar;android', sendPosition='yes'})
function p.featureCategories (frame, debugArgs)
	local args = debugArgs or frame:getParent().args

	if languages.languageFromTitle(mw.title.getCurrentTitle()) ~= 'en' then
		-- TODO: add category with language prefix if category exists
		return ''
	end
	
	local sortKey
	
	if not args.license then
		sortKey = '?'
	elseif string.lower(args.license):find('proprietary') then
		if args.status == 'broken' then
			return ''
		end
		
		sortKey = 'Proprietary'
	else
		if args.status == 'unmaintained' then
			sortKey = 'Unmaintained'
		elseif args.status == 'broken' then
			sortKey = 'X'
		else
			sortKey = 'Open source' -- educated guess
		end
	end
	
	local txt = ''
	
	-- TODO: add category 3D software

	if not args.platform then
		return txt
	end
	
	local platforms = {}
	for _, item in pairs(mw.text.split(args.platform, '[;,]')) do
		key = mw.ustring.lower(
			mw.text.split( -- take the first word to detect e.g. "Android 5.0+" as android
				mw.text.trim(item), ' '
			)[1]
		)
		platforms[key] = true
	end
	
	if platforms.android then
		for arg, desc in pairs(FEATURES) do
			if args[arg] and args[arg] ~= '' and args[arg] ~= 'no' then
		    	txt = txt .. '[[Category:Android apps that can ' .. desc .. '|' .. sortKey .. ']]'
		    end
		end
	end
	
	return txt
end

return p

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.