<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tiffa.net/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AIPA%2Fcategory_documentation</id>
	<title>Module:IPA/category documentation - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tiffa.net/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AIPA%2Fcategory_documentation"/>
	<link rel="alternate" type="text/html" href="https://wiki.tiffa.net/w/index.php?title=Module:IPA/category_documentation&amp;action=history"/>
	<updated>2026-04-17T16:44:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.tiffa.net/w/index.php?title=Module:IPA/category_documentation&amp;diff=155879&amp;oldid=prev</id>
		<title>Fire: Created page with &quot;require(&#039;strict&#039;)  local p = {} local lects = mw.loadData(&#039;Module:IPA/data/export&#039;) local mLang = require(&#039;Module:Lang&#039;)  function p.lookup_name( name ) 	for _, lect in ipairs(lects) do 		if (lect.name or lect.extName) == name then 			return lect.code, lect, lect.parent 		end 	end  	local code = mLang._tag_from_name({ name }) 	if not code:find(&#039;^&lt;span&#039;) then 		local regionCode = code:match(&#039;-(.+)&#039;) 		if regionCode and regionCode:sub(1, 2) ~= &#039;x-&#039; then 			code = code:sub(...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.tiffa.net/w/index.php?title=Module:IPA/category_documentation&amp;diff=155879&amp;oldid=prev"/>
		<updated>2025-06-19T00:50:49Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;require(&amp;#039;strict&amp;#039;)  local p = {} local lects = mw.loadData(&amp;#039;Module:IPA/data/export&amp;#039;) local mLang = require(&amp;#039;Module:Lang&amp;#039;)  function p.lookup_name( name ) 	for _, lect in ipairs(lects) do 		if (lect.name or lect.extName) == name then 			return lect.code, lect, lect.parent 		end 	end  	local code = mLang._tag_from_name({ name }) 	if not code:find(&amp;#039;^&amp;lt;span&amp;#039;) then 		local regionCode = code:match(&amp;#039;-(.+)&amp;#039;) 		if regionCode and regionCode:sub(1, 2) ~= &amp;#039;x-&amp;#039; then 			code = code:sub(...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;strict&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
local lects = mw.loadData(&amp;#039;Module:IPA/data/export&amp;#039;)&lt;br /&gt;
local mLang = require(&amp;#039;Module:Lang&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p.lookup_name( name )&lt;br /&gt;
	for _, lect in ipairs(lects) do&lt;br /&gt;
		if (lect.name or lect.extName) == name then&lt;br /&gt;
			return lect.code, lect, lect.parent&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local code = mLang._tag_from_name({ name })&lt;br /&gt;
	if not code:find(&amp;#039;^&amp;lt;span&amp;#039;) then&lt;br /&gt;
		local regionCode = code:match(&amp;#039;-(.+)&amp;#039;)&lt;br /&gt;
		if regionCode and regionCode:sub(1, 2) ~= &amp;#039;x-&amp;#039; then&lt;br /&gt;
			code = code:sub(1, #code - #regionCode) .. regionCode:upper()&lt;br /&gt;
		end&lt;br /&gt;
		for _, lect in ipairs(lects) do&lt;br /&gt;
			if lect.code == code then&lt;br /&gt;
				return code, lect, lect.parent&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return code, nil, nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return nil, nil, nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = {}&lt;br /&gt;
	for k, v in pairs(frame:getParent().args) do&lt;br /&gt;
		if v ~= &amp;#039;&amp;#039; then&lt;br /&gt;
			args[k] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local name = mw.title.getCurrentTitle().text:sub(12, -5)&lt;br /&gt;
	local lect, parent&lt;br /&gt;
	local code = args.code&lt;br /&gt;
	if not code then&lt;br /&gt;
		code, lect, parent = p.lookup_name( name )&lt;br /&gt;
	end&lt;br /&gt;
	if not code and args.container ~= &amp;#039;yes&amp;#039; then&lt;br /&gt;
		return frame:expandTemplate({ title = &amp;#039;Hidden category&amp;#039; }) .. string.format(&amp;#039;&amp;lt;span class=&amp;quot;error&amp;quot; style=&amp;quot;font-size: 100%%; font-style: normal;&amp;quot;&amp;gt;Error: language code for &amp;quot;%s&amp;quot; not found. Please see [[Template talk:IPA]] for assistance.&amp;lt;/span&amp;gt;[[Category:IPA template errors]]&amp;#039;, name)&lt;br /&gt;
	end&lt;br /&gt;
	local isCollective = name:find(&amp;#039; languages$&amp;#039;) and true&lt;br /&gt;
	local link = lect and (lect.link or lect.generatedLink or lect.extLink)&lt;br /&gt;
		or parent and (parent.link or parent.generatedLink or parent.extLink)&lt;br /&gt;
		or isCollective and name&lt;br /&gt;
		or name .. &amp;#039; language&amp;#039;&lt;br /&gt;
	if not mw.title.new(link).exists then&lt;br /&gt;
		link = mLang._name_from_tag({ code, link = &amp;#039;yes&amp;#039; })&lt;br /&gt;
			:match(&amp;#039;^%[%[([^|%]]+)&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local key = lect and lect.key or parent and parent.key&lt;br /&gt;
	local langCat, langCatCount&lt;br /&gt;
	if code then&lt;br /&gt;
		langCat = mLang._category_from_tag({ code })&lt;br /&gt;
		if langCat:find(&amp;#039;^&amp;lt;span&amp;#039;) then&lt;br /&gt;
			langCat = nil&lt;br /&gt;
		else&lt;br /&gt;
			langCatCount = mw.site.stats.pagesInCategory(langCat:sub(10), &amp;#039;pages&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local parentName = args.parent&lt;br /&gt;
		or parent and (parent.name or mLang._name_from_tag({ parent.code, raw = &amp;#039;yes&amp;#039; }))&lt;br /&gt;
		or code and code:find(&amp;#039;-&amp;#039;) and mLang._name_from_tag({ code:gsub(&amp;#039;%-.*&amp;#039;, &amp;#039;&amp;#039;), raw = &amp;#039;yes&amp;#039; })&lt;br /&gt;
	if parentName == name or parentName and parentName:find(&amp;#039;^&amp;lt;span&amp;#039;) then&lt;br /&gt;
		parentName = nil&lt;br /&gt;
	end&lt;br /&gt;
	local cat = args.cat ~= &amp;#039;no&amp;#039; and (&lt;br /&gt;
		parentName and &amp;#039;Pages with &amp;#039; .. parentName .. &amp;#039; IPA&amp;#039; or &amp;#039;Pages with IPA&amp;#039;&lt;br /&gt;
	)&lt;br /&gt;
	local sortkey = args.sort or name:find(&amp;#039;^[ %l]+$&amp;#039;) and &amp;#039; &amp;#039; .. name or name&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	table.insert(ret, frame:expandTemplate({ title = &amp;#039;Tracking category&amp;#039; }))&lt;br /&gt;
	table.insert(ret, string.format(&lt;br /&gt;
		&amp;#039;The following pages contain [[International Phonetic Alphabet|IPA]] transcriptions of [[%s|%s]] using %s. This category should never be added manually.&amp;#039;,&lt;br /&gt;
		link,&lt;br /&gt;
		name,&lt;br /&gt;
		code&lt;br /&gt;
			and string.format(&amp;#039;&amp;lt;code&amp;gt;{{[[Template:IPA|IPA]]|%s|...}}&amp;lt;/code&amp;gt;&amp;#039;, code)&lt;br /&gt;
			or &amp;#039;[[Template:IPA]]&amp;#039;&lt;br /&gt;
	))&lt;br /&gt;
	if key then&lt;br /&gt;
		table.insert(ret, string.format(&lt;br /&gt;
			&amp;#039;By default, the transcriptions are linked to the [[%s]] key. Transcriptions that do not adhere to the conventions of the key must have &amp;lt;code&amp;gt;|generic=yes&amp;lt;/code&amp;gt;.&amp;#039;,&lt;br /&gt;
			key&lt;br /&gt;
		))&lt;br /&gt;
	end&lt;br /&gt;
	if isCollective or args.collective == &amp;#039;yes&amp;#039; then&lt;br /&gt;
		table.insert(ret, string.format(&lt;br /&gt;
			&amp;#039;%s a language collective. Please replace the code%s with those of more specific languages where possible.&amp;#039;,&lt;br /&gt;
			isCollective and string.format(&amp;#039;The %s are&amp;#039;, name) or string.format(&amp;#039;%s is&amp;#039;, name),&lt;br /&gt;
			code and &amp;#039; (&amp;#039; .. code .. &amp;#039;)&amp;#039; or &amp;#039;&amp;#039;&lt;br /&gt;
		))&lt;br /&gt;
	end&lt;br /&gt;
	if args.content then&lt;br /&gt;
		table.insert(ret, args.content)&lt;br /&gt;
	end&lt;br /&gt;
	if langCat and langCatCount ~= 0 then&lt;br /&gt;
		table.insert(ret, string.format(&lt;br /&gt;
			&amp;#039;==See also==\n*[[:%s]] (%s)&amp;#039;,&lt;br /&gt;
			langCat,&lt;br /&gt;
			mw.language.new(&amp;#039;en&amp;#039;):formatNum(langCatCount)&lt;br /&gt;
		))&lt;br /&gt;
	end&lt;br /&gt;
	if cat then&lt;br /&gt;
		table.insert(ret, string.format(&amp;#039;[[Category:%s|%s]]&amp;#039;, cat, sortkey))&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(ret, &amp;#039;\n\n&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Fire</name></author>
	</entry>
</feed>