Module:Sandbox/Erutuon/random

local p = {}

local Out_mt = {}
Out_mt.__index = Out_mt

function Out_mt:add(...)
	for i = 1, select('#', ...) do
		self.i = self.i + 1
		self[self.i] = select(i, ...)
	end
end

function Out_mt:__tostring()
	return table.concat(self)
end

function Out()
	local o = setmetatable({}, Out_mt)
	o.i = 0
	return o
end

function p.show(frame)
	local out = Out()
	
	local language_data = require 'Module:Wikt-lang/data'
	local Wiktionary = {
		--name_to_code = require 'Module:Language/Wiktionary name to code',
		--code_to_name = require 'Module:Language/Wiktionary code to name',
	}
	
	for code, data in require 'Module:TableTools'.sortedPairs(language_data.languages) do
		if not Wiktionary.code_to_name[code] then
			out:add(code)
			local Wiktionary_code = data.name and Wiktionary.name_to_code[data.name]
			if Wiktionary_code then
				out:add(' → ', Wiktionary_code)
				local MediaWiki_name = mw.language.fetchLanguageName(Wiktionary_code, 'en')
				if MediaWiki_name ~= data.name then
					out:add(' (MediaWiki: ',
						MediaWiki_name ~= '' and MediaWiki_name or '<none>',
						', Wiktionary: ', data.name, ')')
				end
			end
			out:add('\n* ')
		elseif data.name and data.name == mw.language.fetchLanguageName(code, 'en') then
			out:add(code, ' (', data.name, ')')
			out:add('\n* ')
		end
	end
	
	return out
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.