Module:languages/javascript-interface

Hello, you have come here looking for the meaning of the word Module:languages/javascript-interface. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:languages/javascript-interface, but we will also tell you about its etymology, its characteristics and you will know how to say Module:languages/javascript-interface in singular and plural. Everything you need to know about the word Module:languages/javascript-interface you have here. The definition of the word Module:languages/javascript-interface will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:languages/javascript-interface, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
local split = require("Module:string utilities").split

local export = {}

function string.starts(String,Start)
   return string.sub(String,1,string.len(Start))==Start
end

--used by translation adder for language autocompletion
function export.GetSingleLanguageByLanguagePrefix(prefix)
	local byName = require("Module:languages/by name")
	local found_code = nil
	local found_name = nil
	for name, code in pairs(byName) do
		if (string.starts(name, prefix.args)) then 
			if found_code == nil or found_code == code then
				found_code = code
				found_name = name
			else
				return ""
			end
		end
	end
	if found_code ~= nil then
		return found_code..":"..found_name
	else 
		return "" end
end

--translation adder may prefetch all data and do processing on client side
function export.GetAllData()
	local byName = require("Module:languages/by name")
	return require("Module:JSON").toJSON(byName)
end

function export.AllCanonicalToCode()
	local byCanonicalName = require("Module:languages/canonical names")
	return require("Module:JSON").toJSON(byCanonicalName)
end

function export.AllCodeToCanonical()
	local codeToName = require("Module:languages/code to canonical name")
	return require("Module:JSON").toJSON(codeToName)
end

function export.AllLangcodeToScripts()
	local resultData = {}
	for code, data in pairs(require("Module:languages/data/all")) do
		if type(data) == "string" then
			data = split(data, ",", true, true)
		end
		resultData = data
	end
	return require("Module:JSON").toJSON(resultData)
end

function export.GetLanguagesWithAutomaticTransliteration()
	local resultData = {}
	for code, data in pairs(require("Module:languages/data/all")) do
		if data.override_translit == true then
			resultData = true
		end
	end
	return require("Module:JSON").toJSON(resultData)
end

function export.AllWiktionaryCodeToWikimediaCode()
	local resultData = {}
	for code, data in pairs(require("Module:languages/data/all")) do
		if type(data.wikimedia_codes) == "string" then
			data.wikimedia_codes = split(data.wikimedia_codes, ",", true, true)
		end
		resultData = data.wikimedia_codes
	end
	return require("Module:JSON").toJSON(resultData)
end

return export