Wiktionary
gdwiktionary
https://gd.wiktionary.org/wiki/Pr%C3%AComh-Dhuilleag
MediaWiki 1.47.0-wmf.18
case-sensitive
Meadhan
Sònraichte
Deasbaireachd
Cleachdaiche
Deasbaireachd a' chleachdaiche
Wiktionary
An deasbaireachd aig Wiktionary
Faidhle
Deasbaireachd an fhaidhle
MediaWiki
Deasbaireachd MediaWiki
Teamplaid
Deasbaireachd na teamplaid
Cobhair
Deasbaireachd na cobharach
Roinn-seòrsa
Deasbaireachd na roinn-seòrsa
TimedText
TimedText talk
Mòideal
Deasbaireachd mòideil
Event
Event talk
Mòideal:languages/templates
828
3586
89245
10495
2026-09-04T02:03:06Z
Altronic
4137
update to newest version
89245
Scribunto
text/plain
local export = {}
local concat = table.concat
local insert = table.insert
local sort = table.sort
local scripts_module = "Module:scripts"
local function get_script_by_code(...)
get_script_by_code = require(scripts_module).getByCode
return get_script_by_code(...)
end
function export.exists(frame)
return require("Module:languages").getByCode(
require("Module:parameters").process(frame.args, {
[1] = {required = true}
})[1]
) and "1" or ""
end
do
local function getByCode(frame, allow_etym)
local plain = true
local args = require("Module:parameters").process(frame.args, {
[1] = {required = true, type = allow_etym and "language" or "full language"},
[2] = {required = true},
[3] = plain,
[4] = plain,
[5] = plain,
})
local function check_empty(...)
local varargs = {...}
for i = 1, select("#", ...) do
if args[varargs[i]] then
error(("Cannot specify a value for argument %s= when using subfunction '%s' of getByCode()"):format(
varargs[i], args[2]))
end
end
end
return require("Module:language-like").templateGetByCode(args,
function(itemname)
local list
if itemname == "getWikimediaLanguages" then
list = args[1]:getWikimediaLanguages()
elseif itemname == "getScripts" then
list = args[1]:getScriptCodes()
elseif itemname == "getAncestors" then
list = args[1]:getAncestors()
end
if list then
check_empty(4, 5)
local retval = list[tonumber(args[3]) or error("Please specify the numeric index of the desired item in 3=.")]
if retval then
if type(retval) == "string" then
return retval
else
return retval:getCode()
end
else
return ""
end
end
if itemname == "transliterate" then
local sc = get_script_by_code(args[4])
return (args[1]:transliterate(args[3], sc, args[5])) or ""
elseif itemname == "makeDisplayText" then
local sc = get_script_by_code(args[4])
check_empty(5)
return (args[1]:makeDisplayText(args[3], sc)) or ""
elseif itemname == "makeEntryName" then
-- FIXME, find places that use makeEntryName and convert to stripDiacritics
local sc = get_script_by_code(args[4])
check_empty(5)
return args[1]:makeEntryName(args[3], sc) or ""
elseif itemname == "stripDiacritics" then
local sc = get_script_by_code(args[4])
check_empty(5)
return args[1]:stripDiacritics(args[3], sc) or ""
elseif itemname == "makeSortKey" then
local sc = get_script_by_code(args[4])
check_empty(5)
return (args[1]:makeSortKey(args[3], sc)) or ""
elseif itemname == "logicalToPhysical" then
check_empty(4, 5)
return args[1]:logicalToPhysical(args[3]) or ""
elseif itemname == "countCharacters" then
local sc = get_script_by_code(args[4])
check_empty(5)
return sc:countCharacters(args[3] or "")
elseif itemname == "findBestScript" then
check_empty(5)
return args[1]:findBestScript(args[3] or "", args[4]):getCode()
end
end
)
end
-- Used by the following JS:
-- * [[WT:ACCEL]]
-- * [[WT:EDIT]]
-- * [[WT:NEC]]
function export.getByCode(frame)
return getByCode(frame, false)
end
function export.getByCodeAllowEtym(frame)
return getByCode(frame, true)
end
end
function export.getByCanonicalName(frame)
return require("Module:parameters").process(frame.args, {
[1] = {required = true, type = "language", method = "name"}
})[1]:getCode() or ""
end
function export.getCanonicalName(frame)
local args = require("Module:parameters").process(
require("Module:yesno")(frame.args.parent) and frame:getParent().args or frame.args,
{
[1] = {required = true},
["return_if_invalid"] = {type = "boolean"},
}
)
local lang = require("Module:languages").getByCode(args[1], nil, true)
return lang and lang:getCanonicalName() or not args.return_if_invalid and "" or args[1]
end
function export.getFull(frame)
local args = require("Module:parameters").process(
require("Module:yesno")(frame.args.parent) and frame:getParent().args or frame.args,
{
[1] = {required = true, type = "language"},
}
)
return args[1]:getFullCode()
end
function export.getChildren(frame)
local args = require("Module:parameters").process(
require("Module:yesno")(frame.args.parent) and frame:getParent().args or frame.args,
{
[1] = {required = true, type = "language"},
}
)
local children = args[1]:getChildren()
sort(children, function(a, b)
return a:getCanonicalName() < b:getCanonicalName()
end)
local list = {}
for _, child in ipairs(children) do
insert(list, "* " .. child:makeWikipediaLink() .. ": " .. "<code>" .. child:getCode() .. "</code>")
end
return concat(list, "\n")
end
return export
qdh1xhluqselp7bdeiagt3jsbb6ur2q
Cleachdaiche:Altronic
2
16654
89244
89035
2026-09-04T02:00:44Z
Altronic
4137
89244
wikitext
text/x-wiki
{{Babel|en|ga-2|gd-2|ja-2|gv-1|br-0|cy-0|kw-0}}
'S e [https://gd.wiktionary.org/w/index.php?title=S%C3%B2nraichte:ListUsers&group=sysop rianadair] air an uicidh seo a th' annam.
Tha mi a' cur MediaWiki Gadgetean agus scriptean na JavaScript ris an uicidh seo an-dràsta. Ma tha thu a' tachairt mearachd sam bith, innis mi air mo dhuilleag na deasbaireachd.
===TODO===
# Fix and import lua modules.
# Fix generated text strings from these modules and translate others.
# Fix old entries and delete any that are SOP/otherwise out of scope.
# Set out the entry guidelines on here in Gaelic properly.
# Get the language names working properly.
c64jyef3kc33027te82tqyejpe59756
Mòideal:Babel
828
16655
89246
86141
2026-09-04T02:30:06Z
Altronic
4137
update text
89246
Scribunto
text/plain
local export = {}
--[==[ intro: This module implements {{tl|Babel}}, using [[Module:Babel/data]]
and [[Special:PrefixIndex/Module:Babel/data/|its subpages]]
to store translated text. Further usage can be found at the
documentation page of {{tl|Babel}}. ]==]
local concat = table.concat
local find = string.find
local gmatch = string.gmatch
local gsub = string.gsub
local lower = string.lower
local match = string.match
local next = next
local sub = string.sub
local upper = string.upper
local M = require("Module:module loader").init({
require = {
families = "Module:families",
languages = "Module:languages",
load = "Module:load",
pages = "Module:pages",
parameters = "Module:parameters",
scripts = "Module:scripts",
script_utilities = "Module:script utilities",
string_utilities = "Module:string utilities",
track = "Module:debug/track",
},
loadData = {
data = "Module:Babel/data",
},
})
local function is_userpage()
local title = mw.title.getCurrentTitle()
return title:inNamespace("Cleachdaiche") and title.text == title.rootText
end
local function soft_error(key, message)
if is_userpage() then
M.track("Babel/" .. key)
end
return tostring(mw.html.create("span"):addClass("error"):wikitext(message))
end
local function process(code)
return
gsub(code, "-[012345N]$", ""),
match(code, "-([012345N])$") or "N"
end
local message_memo = {}
local function grab_message(lang, proficiency, type)
if message_memo[lang .. proficiency] then
return message_memo[lang .. proficiency]
elseif type == ("language" or "sign language") then
local subpage = M.load.safe_load_data("Module:Babel/data/" .. sub(lang, 1, 1))
if subpage and subpage[lang .. "-" .. proficiency] then
message_memo[lang .. proficiency] = subpage[lang .. "-" .. proficiency]
return message_memo[lang .. proficiency], true -- The boolean indicates it's translated for tagging purposes.
end
elseif type == "script" then
local message = M.data.script_messages[lang .. "-" .. proficiency]
if message then
message_memo[lang .. proficiency] = message
return message
end
end
if not proficiency then
error("Message for " .. lang .. " was not grabbed because proficiency was not provided.")
else
-- Fetch from /data based on type.
message_memo[type .. proficiency] = M.data[type .. "_proficiencies"][proficiency]
or soft_error("invalid proficiency", "Invalid proficiency: " .. proficiency)
end
return message_memo[type .. proficiency]
end
local function special_table(code)
if not code then
return tostring(mw.html.create("div")
:css("text-align", "center")
:css("font-style", "italic")
:wikitext("You haven't set up any languages. "
.. "Please see [[Wiktionary:Babel]] for help."))
elseif code == "-" then
local div = mw.html.create("div"):css("float", "left"):css("margin", "2px")
local tbl = div:tag("table"):attr("cellspacing", "0"):css("width", "238px")
local row = tbl:tag("tr")
row:tag("td"):css("width", "45px"):css("height", "45px"):wikitext(" ")
row:tag("td"):css("font-size", "8pt"):css("padding", "4pt"):css("line-height", "1.25em"):wikitext(" ")
return tostring(div)
elseif code == "----" then
return tostring(mw.html.create("div")
:css("clear", "both")
:css("padding", "0.25em 0")
:tag("hr"))
else
--[[ This doesn't have the same checks as make_table, so it needs to
be able to deal with the fact you can technically pass something like
----- and bypass all the langcode checks. ]]
error(code .. " is not a recognised feature; please see [[Template:"
.. "Babel/documentation]] for a list of these.")
end
end
local function generate_cats(lang, proficiency, type, script, fallback)
if not lang then
error("Categories could not be generated because language code was not provided.")
elseif script then
-- for example, ko-Kore should categorise as ko, ko-Kore, Kore
return {
"Category:Cleachdaiche " .. lang .. "-" .. script .. "-" .. proficiency,
"Category:Cleachdaiche " .. lang .. "-" .. script,
"Category:Cleachdaiche " .. lang .. "-" .. proficiency,
"Category:Cleachdaiche " .. lang,
"Category:Cleachdaiche " .. script .. "-" .. proficiency,
"Category:Cleachdaiche " .. script,
}
elseif fallback and fallback ~= lang then
return {
"Category:Cleachdaiche " .. lang .. "-" .. proficiency,
"Category:Cleachdaiche " .. lang,
"Category:Cleachdaiche " .. fallback .. "-" .. proficiency,
"Category:Cleachdaiche " .. fallback,
}
elseif type == "programming" then
return {
"Category:Cleachdaiche " .. lang .. " coder-" .. proficiency,
"Category:Cleachdaiche " .. lang .. " coder",
}
else
return {
"Category:Cleachdaiche " .. lang .. "-" .. proficiency,
"Category:Cleachdaiche " .. lang,
}
end
end
--[==[ This is where modules can interface with Babel. `data` is a table
containing the following arguments:
* `obj` '''usually required''': Language, script, or family object.
* `lang`: Language code as a string. This is '''required''' if obj is not passed.
* `code` '''required''': Language code affixed with proficiency (or, if unaffixed, proficiency should be native).
* `proficiency` '''required''': This can be 0, 1, 2, 3, 4, 5, or N.
* `text` '''required''': Text to display in the box.
* `type`: Used to determine what formatting to use. This is '''required''' if the box being generated is for a script, (non-sign) language, or programming language.
* `glyph`: The glyph to show above the script code. This is '''required''' for scripts.
* `prog_obj`: Programming language data from [[Module:Babel/data]]. This is '''required''' if the box being generated is for a programming language.
* `translated`: Whether `text` is in English. If this is set to {true}, the text will be appropriately tagged with [[Module:script utilities]].
]==]
function export.generate_box(data)
if not (data.obj or data.lang) then
error("generate_box received neither `obj` nor `lang`.")
elseif not (data.code and data.proficiency) then
error("`code` and `proficiency` must be passed to generate_box.")
end
local lang = data.obj and data.obj:getCode() or data.lang
local root = mw.html.create("div")
:addClass("babel-box")
:addClass("babel-" .. data.proficiency)
local tbl = root:tag("table"):addClass("babel-content")
local row = tbl:tag("tr")
if data.type == "script" then
if not data.glyph then
error("Glyph must be passed to generate_box, because " .. lang .. " is a script code.")
end
if lang ~= "Latn" then
if data.glyph == "A" then
M.track("Babel/missing script glyph")
end
if not find(lang, "[IU]PA") then
data.glyph = M.script_utilities.tag_text(data.glyph, M.scripts.getByCode())
else
data.glyph = tostring(mw.html.create("span"):addClass("IPA"):wikitext(data.glyph))
end
end
local td_code = mw.html.create("td"):addClass("babel-code")
:css("font-size", "9pt")
:css("line-height", "100%")
td_code:tag("span")
:css("font-size", "14pt")
:css("line-height", "130%")
:wikitext(data.glyph)
td_code:tag("br")
td_code:tag("b"):wikitext(data.code)
local td_text = mw.html.create("td"):addClass("babel-text"):wikitext(data.text)
row:node(td_code):node(td_text)
else
if data.type == "programming" then
data.link = ("[[" .. (data.prog_obj.link) .. "|" .. (data.prog_obj.display_code or lang) .. "]]") or ""
data.text = M.string_utilities.plain_gsub(data.text, "|" .. lang, "|" .. (data.prog_obj.display or data.prog_obj.display_code or lang))
if lang ~= data.code then
data.link = data.link .. "-" .. data.proficiency
end
else
if data.type == "language" then
data.dir = "left"
if data.obj and find(data.obj:findBestScript(data.text):getDirection(), "rtl") then
data.dir = "right"
end
if data.script then
lang = lang .. "-" .. data.script
end
end
-- Display what was inputted - en for en, en-N for en-N.
local proficiency_suffix = ""
data.link = data.link or lang
if data.link ~= data.code then
proficiency_suffix = "-" .. data.proficiency
end
data.link = "[[w:ISO 639:" .. data.link .. "|" .. data.link .. "]]" .. proficiency_suffix
if data.obj and data.translated then
local tagged = {}
local n = 1
for i in gmatch(gsub(data.text, "<[hb]r>", "\n"), "[^\n]+") do
tagged[n] = M.script_utilities.tag_text(i, data.obj)
n = n + 1
end
data.text = concat(tagged, match(data.text, "<[hb]r>"))
end
end
local td_code = mw.html.create("td"):addClass("babel-code"):css("font-size", "14pt")
td_code:tag("b"):wikitext(data.link)
local td_text = mw.html.create("td"):addClass("babel-text")
if data.dir and data.dir ~= "" then
td_text:css("text-align", data.dir)
end
td_text:wikitext(data.text)
row:node(td_code):node(td_text)
end
return tostring(root)
end
local generate_box = export.generate_box
local function make_table(code, inactive)
if not code or find(code, "^[-]+$") then
return special_table(code)
elseif find(code, "UNIQ") then
--[[ If it has a MW strip marker, it's probably a template or some
other rubbish that shouldn't be passed. ]]
error("Do not pass a template as a parameter.")
end
local lang, proficiency = process(code)
local data = { code = code, proficiency = proficiency, lang = lang }
--[[ Data needs to have 4 things to be able to build the table:
- `type` of table to make: language, script, proglang, or family
- `message`, which is either fetched from /data or /data/...
- `langname`, for $3 in the generic messages
- `link`, to be displayed on the left
If the message is translated, it will also have an item `translated`
indicating that.
Script data will also have a glyph.
Programming languages will sometimes have custom codes to display, and,
for internal use only, a titlecase version of the name (e.g. Php for
PHP, Asm for asm, etc.). ]]
if find(lang, "-%u%l+$") then
-- Allow language codes affixed with script codes.
data.script = match(data.lang, "-(%u%l+)$")
data.display_code = data.lang
data.lang = gsub(data.lang, "-%u%l+$", "")
if not M.scripts.getByCode(data.script) then
return soft_error("invalid script code", "Invalid script code: " .. data.script)
end
end
local type
type, data.obj = next{
language = M.languages.getByCode(data.lang, nil, true),
script = M.scripts.getByCode(data.lang),
family = M.families.getByCode(data.lang),
}
if data.obj then
data.langname = data.obj:getCanonicalName()
if type == "language" then
local full_code = data.obj:getFullCode()
if full_code ~= data.lang then
data.fallback = full_code
end
end
data.type = type
local is_sign_language = (type == "language" and data.obj:inFamily("sgn") and "sign_") or ""
data.text, data.translated = grab_message(data.lang .. (data.script and "-" .. data.script or ""), proficiency, is_sign_language .. data.type)
else
data.titlecase = upper(sub(lang, 1, 1)) .. lower(sub(lang, 2, -1))
local locations = {
programming = M.data.proglangs[data.titlecase],
language = M.data.custom_codes[data.lang],
script = {
--[[ Invalid in Module:scripts but still used, so exceptions should
be made for these two. Probably should be phased out. ]]
["IPA"] = "IPA",
["UPA"] = "UPA",
},
}
locations.script = locations.script[data.lang]
locations.language = locations.language and locations.language[1]
local langname
type, langname = next(locations)
if type == "programming" then
data.type = type
data.text = grab_message(data.lang, data.proficiency, type)
data.langname = data.lang
elseif langname then
data.type = type
data.text, data.translated = grab_message(data.lang .. (data.script and "-" .. data.script or ""), data.proficiency, data.type)
data.langname = langname
if type == "language" then
M.track("Babel/custom code")
local custom = M.data.custom_codes[data.lang]
data.obj = M.languages.getByCode(custom.fallback) -- auto cat won't work for custom codes, so use the fallback to categorise
data.link = data.lang
end
else
return soft_error("invalid language code", "Invalid language code: " .. lang)
end
end
if data.type == "script" then
data.glyph = M.data.script_glyphs[lang] or "A"
end
if data.script then
data.cats = generate_cats(data.obj:getCode(), data.proficiency, data.type, data.script)
elseif data.type ~= "programming" then
data.cats = generate_cats(data.obj and data.obj:getCode() or data.lang, data.proficiency, data.type, nil, data.fallback)
else
data.prog_obj = M.data.proglangs[data.titlecase]
data.cats = generate_cats((data.prog_obj.cat or data.prog_obj.display or data.titlecase), proficiency, data.type)
end
if not data.translated then
data.text = gsub(data.text, "$1", ":" .. data.cats[1])
data.text = gsub(data.text, "$2", ":" .. data.cats[2])
data.text = gsub(data.text, "$3", data.langname)
else
data.text = gsub(data.text, "$1", ":" .. data.cats[1])
data.text = gsub(data.text, "$2", ":" .. data.cats[2])
if find(data.text, "{") then
data.text = gsub(data.text, "{[^}]-}",
-- Gender parsing.
function(arg)
local parts = {}
local n = 1
for part in gmatch(arg, "[^/{}]+") do
parts[n] = part
n = n + 1
end
if not parts then
soft_error("malformed gender switch", "Malformed gender switch in message for " .. code .. ": " .. arg)
end
return mw.language.getContentLanguage():gender(mw.title.getCurrentTitle().rootText, parts)
end)
end
if find(data.text, "hiero") then
data.text = mw.getCurrentFrame():preprocess(data.text)
end
end
local ret = generate_box(data)
if data.cats and is_userpage() and proficiency ~= "0" then
if not inactive then
ret = ret .. "[[" .. concat(data.cats, "]][[") .. "]]"
else
for i = 1, #data.cats do
ret = ret .. "[[" .. data.cats[i] .. " (inactive)]]"
end
end
end
return ret
end
--[==[ Entry point for {{tl|Babel userbox}}. ]==]
function export.t_userbox(frame)
local args = M.parameters.process(frame:getParent().args, {
[1] = true,
["inactive"] = true,
})
return make_table(args[1], args["inactive"])
end
--[==[ Main entry point, for {{tl|Babel}}. ]==]
function export.show(frame)
local args = M.parameters.process(frame:getParent().args, {
[1] = { list = true },
["inactive"] = { type = "boolean" },
["float"] = { set = { "left", "right", "none", "center" }, default = "right" },
["align"] = { alias_of = "float" },
["margin_left"] = { default = "1em" },
["margin_right"] = { default = "0em" },
["margin_bottom"] = { default = "0.5em" },
["width"] = { default = "248px" },
["border_color"] = { default = "var(--wikt-palette-blue-5, #99B3FF)" },
["header"] = { default = "[[Wiktionary:Babel]]" },
["color"] = { default = "inherit" },
["footer"] = {
default = "Lorg [[:Category:Cànan nan cleachdaichean|"
.. "cànan nan cleachdaichean]] no [[:Category:Litridhean nan cleachdaichean|"
.. "litridhean]]"
},
["border"] = { alias_of = "border_color" },
["bordercolor"] = { alias_of = "border_color" },
["gender"] = true,
["g"] = { alias_of = "gender" },
["no-table"] = { boolean = true },
})
local column_parts = { {} }
local current_column = 1
local has_box = false
if not args[1][1] then
local box = make_table()
column_parts[1][1] = box
has_box = true
else
for i = 1, #args[1] do
local code = args[1][i]
if code == "!" then
if #column_parts[current_column] > 0 then
current_column = current_column + 1
column_parts[current_column] = {}
end
else
local box = make_table(code, args["inactive"])
column_parts[current_column][#column_parts[current_column] + 1] = box
has_box = true
end
end
end
if not has_box then
column_parts = { { make_table() } }
end
local column_contents = {}
for i = 1, #column_parts do
local content = concat(column_parts[i], "")
if content ~= "" then
column_contents[#column_contents + 1] = content
end
end
if args["no-table"] then
return concat(column_contents, "")
end
local colspan = #column_contents
if args["inactive"] then
local inactive_span = mw.html.create("span")
:attr("title", "This user has not contributed in 2 or more years.")
:wikitext("(inactive)")
args["header"] = args["header"] .. " " .. tostring(inactive_span)
end
if args["gender"] and M.pages.is_preview() then
local gender_span = mw.html.create("span")
:addClass("error")
:css("font-size", "75%")
:wikitext("Gender is automatically grabbed from your preferences.\nYou can remove the gender parameter.")
args["header"] = args["header"] .. "\n" .. tostring(gender_span)
end
if args["float"] == "center" then
args["float"] = "none"
args["margin_left"] = "auto"
args["margin_right"] = "auto"
end
local tbl = mw.html.create("table")
:addClass("babel-box-wrapper")
:addClass("userboxes")
:attr("name", "userboxes")
:css("float", args["float"])
:css("margin-left", args["margin_left"])
:css("margin-right", args["margin_right"])
:css("margin-bottom", args["margin_bottom"])
:css("width", args["width"])
:css("border", args["border_color"] .. " solid 1px")
:css("clear", args["float"])
local header_row = mw.html.create("tr")
header_row:tag("th")
:attr("colspan", colspan)
:css("background-color", args["color"])
:css("text-align", "center")
:wikitext(args["header"])
local content_row = mw.html.create("tr"):css("vertical-align", "top")
for i = 1, #column_contents do
content_row:tag("td"):wikitext(column_contents[i])
end
local footer_row = mw.html.create("tr")
footer_row:tag("td")
:attr("colspan", colspan)
:css("background-color", args["color"])
:css("text-align", "center")
:wikitext(args["footer"])
tbl:node(header_row):node(content_row):node(footer_row)
return tostring(tbl)
end
return export
sus9mewabfg2pfuzsme5j51zcnkbe22
89247
89246
2026-09-04T02:34:14Z
Altronic
4137
89247
Scribunto
text/plain
local export = {}
--[==[ intro: This module implements {{tl|Babel}}, using [[Module:Babel/data]]
and [[Special:PrefixIndex/Module:Babel/data/|its subpages]]
to store translated text. Further usage can be found at the
documentation page of {{tl|Babel}}. ]==]
local concat = table.concat
local find = string.find
local gmatch = string.gmatch
local gsub = string.gsub
local lower = string.lower
local match = string.match
local next = next
local sub = string.sub
local upper = string.upper
local M = require("Module:module loader").init({
require = {
families = "Module:families",
languages = "Module:languages",
load = "Module:load",
pages = "Module:pages",
parameters = "Module:parameters",
scripts = "Module:scripts",
script_utilities = "Module:script utilities",
string_utilities = "Module:string utilities",
track = "Module:debug/track",
},
loadData = {
data = "Module:Babel/data",
},
})
local function is_userpage()
local title = mw.title.getCurrentTitle()
return title:inNamespace("Cleachdaiche") and title.text == title.rootText
end
local function soft_error(key, message)
if is_userpage() then
M.track("Babel/" .. key)
end
return tostring(mw.html.create("span"):addClass("error"):wikitext(message))
end
local function process(code)
return
gsub(code, "-[012345N]$", ""),
match(code, "-([012345N])$") or "N"
end
local message_memo = {}
local function grab_message(lang, proficiency, type)
if message_memo[lang .. proficiency] then
return message_memo[lang .. proficiency]
elseif type == ("language" or "sign language") then
local subpage = M.load.safe_load_data("Module:Babel/data/" .. sub(lang, 1, 1))
if subpage and subpage[lang .. "-" .. proficiency] then
message_memo[lang .. proficiency] = subpage[lang .. "-" .. proficiency]
return message_memo[lang .. proficiency], true -- The boolean indicates it's translated for tagging purposes.
end
elseif type == "script" then
local message = M.data.script_messages[lang .. "-" .. proficiency]
if message then
message_memo[lang .. proficiency] = message
return message
end
end
if not proficiency then
error("Message for " .. lang .. " was not grabbed because proficiency was not provided.")
else
-- Fetch from /data based on type.
message_memo[type .. proficiency] = M.data[type .. "_proficiencies"][proficiency]
or soft_error("invalid proficiency", "Invalid proficiency: " .. proficiency)
end
return message_memo[type .. proficiency]
end
local function special_table(code)
if not code then
return tostring(mw.html.create("div")
:css("text-align", "center")
:css("font-style", "italic")
:wikitext("You haven't set up any languages. "
.. "Please see [[Wiktionary:Babel]] for help."))
elseif code == "-" then
local div = mw.html.create("div"):css("float", "left"):css("margin", "2px")
local tbl = div:tag("table"):attr("cellspacing", "0"):css("width", "238px")
local row = tbl:tag("tr")
row:tag("td"):css("width", "45px"):css("height", "45px"):wikitext(" ")
row:tag("td"):css("font-size", "8pt"):css("padding", "4pt"):css("line-height", "1.25em"):wikitext(" ")
return tostring(div)
elseif code == "----" then
return tostring(mw.html.create("div")
:css("clear", "both")
:css("padding", "0.25em 0")
:tag("hr"))
else
--[[ This doesn't have the same checks as make_table, so it needs to
be able to deal with the fact you can technically pass something like
----- and bypass all the langcode checks. ]]
error(code .. " is not a recognised feature; please see [[Template:"
.. "Babel/documentation]] for a list of these.")
end
end
local function generate_cats(lang, proficiency, type, script, fallback)
if not lang then
error("Categories could not be generated because language code was not provided.")
elseif script then
-- for example, ko-Kore should categorise as ko, ko-Kore, Kore
return {
"Category:Cleachdaiche " .. lang .. "-" .. script .. "-" .. proficiency,
"Category:Cleachdaiche " .. lang .. "-" .. script,
"Category:Cleachdaiche " .. lang .. "-" .. proficiency,
"Category:Cleachdaiche " .. lang,
"Category:Cleachdaiche " .. script .. "-" .. proficiency,
"Category:Cleachdaiche " .. script,
}
elseif fallback and fallback ~= lang then
return {
"Category:Cleachdaiche " .. lang .. "-" .. proficiency,
"Category:Cleachdaiche " .. lang,
"Category:Cleachdaiche " .. fallback .. "-" .. proficiency,
"Category:Cleachdaiche " .. fallback,
}
elseif type == "programming" then
return {
"Category:Cleachdaiche " .. lang .. " coder-" .. proficiency,
"Category:Cleachdaiche " .. lang .. " coder",
}
else
return {
"Category:Cleachdaiche " .. lang .. "-" .. proficiency,
"Category:Cleachdaiche " .. lang,
}
end
end
--[==[ This is where modules can interface with Babel. `data` is a table
containing the following arguments:
* `obj` '''usually required''': Language, script, or family object.
* `lang`: Language code as a string. This is '''required''' if obj is not passed.
* `code` '''required''': Language code affixed with proficiency (or, if unaffixed, proficiency should be native).
* `proficiency` '''required''': This can be 0, 1, 2, 3, 4, 5, or N.
* `text` '''required''': Text to display in the box.
* `type`: Used to determine what formatting to use. This is '''required''' if the box being generated is for a script, (non-sign) language, or programming language.
* `glyph`: The glyph to show above the script code. This is '''required''' for scripts.
* `prog_obj`: Programming language data from [[Module:Babel/data]]. This is '''required''' if the box being generated is for a programming language.
* `translated`: Whether `text` is in English. If this is set to {true}, the text will be appropriately tagged with [[Module:script utilities]].
]==]
function export.generate_box(data)
if not (data.obj or data.lang) then
error("generate_box received neither `obj` nor `lang`.")
elseif not (data.code and data.proficiency) then
error("`code` and `proficiency` must be passed to generate_box.")
end
local lang = data.obj and data.obj:getCode() or data.lang
local root = mw.html.create("div")
:addClass("babel-box")
:addClass("babel-" .. data.proficiency)
local tbl = root:tag("table"):addClass("babel-content")
local row = tbl:tag("tr")
if data.type == "script" then
if not data.glyph then
error("Glyph must be passed to generate_box, because " .. lang .. " is a script code.")
end
if lang ~= "Latn" then
if data.glyph == "A" then
M.track("Babel/missing script glyph")
end
if not find(lang, "[IU]PA") then
data.glyph = M.script_utilities.tag_text(data.glyph, M.scripts.getByCode())
else
data.glyph = tostring(mw.html.create("span"):addClass("IPA"):wikitext(data.glyph))
end
end
local td_code = mw.html.create("td"):addClass("babel-code")
:css("font-size", "9pt")
:css("line-height", "100%")
td_code:tag("span")
:css("font-size", "14pt")
:css("line-height", "130%")
:wikitext(data.glyph)
td_code:tag("br")
td_code:tag("b"):wikitext(data.code)
local td_text = mw.html.create("td"):addClass("babel-text"):wikitext(data.text)
row:node(td_code):node(td_text)
else
if data.type == "programming" then
data.link = ("[[" .. (data.prog_obj.link) .. "|" .. (data.prog_obj.display_code or lang) .. "]]") or ""
data.text = M.string_utilities.plain_gsub(data.text, "|" .. lang, "|" .. (data.prog_obj.display or data.prog_obj.display_code or lang))
if lang ~= data.code then
data.link = data.link .. "-" .. data.proficiency
end
else
if data.type == "language" then
data.dir = "left"
if data.obj and find(data.obj:findBestScript(data.text):getDirection(), "rtl") then
data.dir = "right"
end
if data.script then
lang = lang .. "-" .. data.script
end
end
-- Display what was inputted - en for en, en-N for en-N.
local proficiency_suffix = ""
data.link = data.link or lang
if data.link ~= data.code then
proficiency_suffix = "-" .. data.proficiency
end
data.link = "[[w:ISO 639:" .. data.link .. "|" .. data.link .. "]]" .. proficiency_suffix
if data.obj and data.translated then
local tagged = {}
local n = 1
for i in gmatch(gsub(data.text, "<[hb]r>", "\n"), "[^\n]+") do
tagged[n] = M.script_utilities.tag_text(i, data.obj)
n = n + 1
end
data.text = concat(tagged, match(data.text, "<[hb]r>"))
end
end
local td_code = mw.html.create("td"):addClass("babel-code"):css("font-size", "14pt")
td_code:tag("b"):wikitext(data.link)
local td_text = mw.html.create("td"):addClass("babel-text")
if data.dir and data.dir ~= "" then
td_text:css("text-align", data.dir)
end
td_text:wikitext(data.text)
row:node(td_code):node(td_text)
end
return tostring(root)
end
local generate_box = export.generate_box
local function make_table(code, inactive)
if not code or find(code, "^[-]+$") then
return special_table(code)
elseif find(code, "UNIQ") then
--[[ If it has a MW strip marker, it's probably a template or some
other rubbish that shouldn't be passed. ]]
error("Do not pass a template as a parameter.")
end
local lang, proficiency = process(code)
local data = { code = code, proficiency = proficiency, lang = lang }
--[[ Data needs to have 4 things to be able to build the table:
- `type` of table to make: language, script, proglang, or family
- `message`, which is either fetched from /data or /data/...
- `langname`, for $3 in the generic messages
- `link`, to be displayed on the left
If the message is translated, it will also have an item `translated`
indicating that.
Script data will also have a glyph.
Programming languages will sometimes have custom codes to display, and,
for internal use only, a titlecase version of the name (e.g. Php for
PHP, Asm for asm, etc.). ]]
if find(lang, "-%u%l+$") then
-- Allow language codes affixed with script codes.
data.script = match(data.lang, "-(%u%l+)$")
data.display_code = data.lang
data.lang = gsub(data.lang, "-%u%l+$", "")
if not M.scripts.getByCode(data.script) then
return soft_error("invalid script code", "Invalid script code: " .. data.script)
end
end
local type
type, data.obj = next{
language = M.languages.getByCode(data.lang, nil, true),
script = M.scripts.getByCode(data.lang),
family = M.families.getByCode(data.lang),
}
if data.obj then
data.langname = data.obj:getCanonicalName()
if type == "language" then
local full_code = data.obj:getFullCode()
if full_code ~= data.lang then
data.fallback = full_code
end
end
data.type = type
local is_sign_language = (type == "language" and data.obj:inFamily("sgn") and "sign_") or ""
data.text, data.translated = grab_message(data.lang .. (data.script and "-" .. data.script or ""), proficiency, is_sign_language .. data.type)
else
data.titlecase = upper(sub(lang, 1, 1)) .. lower(sub(lang, 2, -1))
local locations = {
programming = M.data.proglangs[data.titlecase],
language = M.data.custom_codes[data.lang],
script = {
--[[ Invalid in Module:scripts but still used, so exceptions should
be made for these two. Probably should be phased out. ]]
["IPA"] = "IPA",
["UPA"] = "UPA",
},
}
locations.script = locations.script[data.lang]
locations.language = locations.language and locations.language[1]
local langname
type, langname = next(locations)
if type == "programming" then
data.type = type
data.text = grab_message(data.lang, data.proficiency, type)
data.langname = data.lang
elseif langname then
data.type = type
data.text, data.translated = grab_message(data.lang .. (data.script and "-" .. data.script or ""), data.proficiency, data.type)
data.langname = langname
if type == "language" then
M.track("Babel/custom code")
local custom = M.data.custom_codes[data.lang]
data.obj = M.languages.getByCode(custom.fallback) -- auto cat won't work for custom codes, so use the fallback to categorise
data.link = data.lang
end
else
return soft_error("invalid language code", "Invalid language code: " .. lang)
end
end
if data.type == "script" then
data.glyph = M.data.script_glyphs[lang] or "A"
end
if data.script then
data.cats = generate_cats(data.obj:getCode(), data.proficiency, data.type, data.script)
elseif data.type ~= "programming" then
data.cats = generate_cats(data.obj and data.obj:getCode() or data.lang, data.proficiency, data.type, nil, data.fallback)
else
data.prog_obj = M.data.proglangs[data.titlecase]
data.cats = generate_cats((data.prog_obj.cat or data.prog_obj.display or data.titlecase), proficiency, data.type)
end
if not data.translated then
data.text = gsub(data.text, "$1", ":" .. data.cats[1])
data.text = gsub(data.text, "$2", ":" .. data.cats[2])
data.text = gsub(data.text, "$3", data.langname)
else
data.text = gsub(data.text, "$1", ":" .. data.cats[1])
data.text = gsub(data.text, "$2", ":" .. data.cats[2])
if find(data.text, "{") then
data.text = gsub(data.text, "{[^}]-}",
-- Gender parsing.
function(arg)
local parts = {}
local n = 1
for part in gmatch(arg, "[^/{}]+") do
parts[n] = part
n = n + 1
end
if not parts then
soft_error("malformed gender switch", "Malformed gender switch in message for " .. code .. ": " .. arg)
end
return mw.language.getContentLanguage():gender(mw.title.getCurrentTitle().rootText, parts)
end)
end
if find(data.text, "hiero") then
data.text = mw.getCurrentFrame():preprocess(data.text)
end
end
local ret = generate_box(data)
if data.cats and is_userpage() and proficiency ~= "0" then
if not inactive then
ret = ret .. "[[" .. concat(data.cats, "]][[") .. "]]"
else
for i = 1, #data.cats do
ret = ret .. "[[" .. data.cats[i] .. " (inactive)]]"
end
end
end
return ret
end
--[==[ Entry point for {{tl|Babel userbox}}. ]==]
function export.t_userbox(frame)
local args = M.parameters.process(frame:getParent().args, {
[1] = true,
["inactive"] = true,
})
return make_table(args[1], args["inactive"])
end
--[==[ Main entry point, for {{tl|Babel}}. ]==]
function export.show(frame)
local args = M.parameters.process(frame:getParent().args, {
[1] = { list = true },
["inactive"] = { type = "boolean" },
["float"] = { set = { "left", "right", "none", "center" }, default = "right" },
["align"] = { alias_of = "float" },
["margin_left"] = { default = "1em" },
["margin_right"] = { default = "0em" },
["margin_bottom"] = { default = "0.5em" },
["width"] = { default = "248px" },
["border_color"] = { default = "var(--wikt-palette-blue-5, #99B3FF)" },
["header"] = { default = "[[Wiktionary:Babel]]" },
["color"] = { default = "inherit" },
["footer"] = {
default = "Lorg [[:Category:Cànan nan cleachdaichean|"
.. "cànan]] no [[:Category:Litridhean nan cleachdaichean|"
.. "litridhean]] nan cleachdaichean"
},
["border"] = { alias_of = "border_color" },
["bordercolor"] = { alias_of = "border_color" },
["gender"] = true,
["g"] = { alias_of = "gender" },
["no-table"] = { boolean = true },
})
local column_parts = { {} }
local current_column = 1
local has_box = false
if not args[1][1] then
local box = make_table()
column_parts[1][1] = box
has_box = true
else
for i = 1, #args[1] do
local code = args[1][i]
if code == "!" then
if #column_parts[current_column] > 0 then
current_column = current_column + 1
column_parts[current_column] = {}
end
else
local box = make_table(code, args["inactive"])
column_parts[current_column][#column_parts[current_column] + 1] = box
has_box = true
end
end
end
if not has_box then
column_parts = { { make_table() } }
end
local column_contents = {}
for i = 1, #column_parts do
local content = concat(column_parts[i], "")
if content ~= "" then
column_contents[#column_contents + 1] = content
end
end
if args["no-table"] then
return concat(column_contents, "")
end
local colspan = #column_contents
if args["inactive"] then
local inactive_span = mw.html.create("span")
:attr("title", "This user has not contributed in 2 or more years.")
:wikitext("(inactive)")
args["header"] = args["header"] .. " " .. tostring(inactive_span)
end
if args["gender"] and M.pages.is_preview() then
local gender_span = mw.html.create("span")
:addClass("error")
:css("font-size", "75%")
:wikitext("Gender is automatically grabbed from your preferences.\nYou can remove the gender parameter.")
args["header"] = args["header"] .. "\n" .. tostring(gender_span)
end
if args["float"] == "center" then
args["float"] = "none"
args["margin_left"] = "auto"
args["margin_right"] = "auto"
end
local tbl = mw.html.create("table")
:addClass("babel-box-wrapper")
:addClass("userboxes")
:attr("name", "userboxes")
:css("float", args["float"])
:css("margin-left", args["margin_left"])
:css("margin-right", args["margin_right"])
:css("margin-bottom", args["margin_bottom"])
:css("width", args["width"])
:css("border", args["border_color"] .. " solid 1px")
:css("clear", args["float"])
local header_row = mw.html.create("tr")
header_row:tag("th")
:attr("colspan", colspan)
:css("background-color", args["color"])
:css("text-align", "center")
:wikitext(args["header"])
local content_row = mw.html.create("tr"):css("vertical-align", "top")
for i = 1, #column_contents do
content_row:tag("td"):wikitext(column_contents[i])
end
local footer_row = mw.html.create("tr")
footer_row:tag("td")
:attr("colspan", colspan)
:css("background-color", args["color"])
:css("text-align", "center")
:wikitext(args["footer"])
tbl:node(header_row):node(content_row):node(footer_row)
return tostring(tbl)
end
return export
m2yjroogo42dr1xo5u9xbr6ozyy5a4b
in
0
18110
89243
2026-09-04T01:52:59Z
Altronic
4137
temporary page, needs to be cleaned up later
89243
wikitext
text/x-wiki
==Beurla==
===Fuaimneachadh===
* {{IPA|en|/ən/|a=weak form}}, {{enPR|ən}}
* {{IPA|en|/ɪn/|a=strong form}}, {{enPR|ĭn}}
* {{IPA|en|/ɘn/|a=NZ,weak form}}
* {{audio|en|LL-Q1860 (eng)-Pvanp7-in a while (unstressed).wav|text=in a while|a=UK,weak form|IPA=/ən‿ə waːl/}}
* {{audio|en|LL-Q1860 (eng)-Pvanp7-in (stressed).wav|a=UK,strong form}}
* {{audio|en|en-us-in.ogg|a=US,strong form}}
* {{audio|en|en-au-in.ogg|a=AU,strong form}}
* {{rhymes|en|ɪn|s=1}}<!--No ən rhyme: can't rhyme a weak form word.-->
* {{homophones|en|an|qq1=weak form|and|qq2=weak form|inn}}
===Freumhachadh===
{{etymon|en|id=preposition|:inh|enm:in<id:preposition>}}
{{PIE word|en|h₁en}}
Tha an roimhear bho {{inh|en|enm|in}}, bho {{inh|en|ang|in}}, bho {{inh|en|gem-pro|*in}}.{{dercat|en|ine-pro|inh=1}}
Tha an co-ghnìomhair bho {{inh|en|enm|in}}, bho {{inh|en|ang|inn}} agus {{m|ang|inne}}, bho {{inh|en|gem-pro|*innai}}.
===Roimhear===
{{en-head|prep}}
# [[ann an]], [[an]]
===Co-ghnìomhair===
{{en-adv|-}}
# [[a-steach]]
#: {{synonyms|gd|into}}
rqv6emnmntna982ygs2ze2aqn9ptfuw