Module:jbo-etym

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

This module jbo-etym requires

  • the "Module:languages" and uses the getByCode function to get the Canonical name for the language.
  • the "Module:links" and uses the full_link function to
    • form strings if '_t' is passed as the last argument.
    • form strings if "_s" is passed as an argument
    • form strings if "_tr" is passed as an argument

The Module jbo-etym is called by the template jbo-etym The module is given an argument which is indexed by one of six strings, which are the six(6) strings used to identify the language that are in the etymology of the Lojban word for this page. These languages are: "zh" (Chinese) "en" (English) "hi" () "es" (Spanish) "ru" (Russian) "ar" (Arabic).

Initially the function export.show retrieves its arguments from the stack from the call to Template:jbo-etym (using frame:getParent().args ) and passes each table element to the function "append" with the language name associated with that argument.

The function append creates a string with the proper format to show the list of languages, and which string in those languages contributed to this lojban entity.


local export = {}

function export.show(frame)
	local args = frame:getParent().args
	
	return
		"''In Lojbanized spelling.''" ..
		append(args, "zh") ..
		append(args, "en") ..
		append(args, "hi") ..
		append(args, "es") ..
		append(args, "ru") ..
		append(args, "ar")
end

function append(args, code)
	local ret = ""
	
	if args then
		local lang = require("Module:languages").getByCode(code)
		ret = ret .. "\n* " .. lang:getCanonicalName() .. ": " .. args
		
		if args then
			local m_links = require("Module:links")
			
			ret = ret ..  " — ".. m_links.full_link({lang = lang, term = args, tr = (args and "")}, nil, true)
			
			-- It seems full_link({term="類"}) now produces something like "類/类" already,
			-- and this is causing jbo-etym to emit simplified forms twice, like "類/类/类 (lèi) (lèi)"
			-- so let's try skipping handling of '_s'.

			-- if args then
			-- 	ret = ret .. "/" .. m_links.full_link({lang = lang, term = args}, nil, true)
			-- end
			
			if args then
				if mw.ustring.find(args,'(){}]') then error('unauthorized characters') end
				ret = ret .. " (" .. args .. ")"
			end
		end
	end
	
	return ret
end

return export