<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.abidanarchive.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ALang%2Futilities</id>
	<title>Module:Lang/utilities - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.abidanarchive.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ALang%2Futilities"/>
	<link rel="alternate" type="text/html" href="https://wiki.abidanarchive.com/index.php?title=Module:Lang/utilities&amp;action=history"/>
	<updated>2026-07-05T19:34:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://wiki.abidanarchive.com/index.php?title=Module:Lang/utilities&amp;diff=1414&amp;oldid=prev</id>
		<title>TransEmo: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.abidanarchive.com/index.php?title=Module:Lang/utilities&amp;diff=1414&amp;oldid=prev"/>
		<updated>2019-10-15T09:46:13Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 09:46, 15 October 2019&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key abidan_wiki:diff::1.12:old-1413:rev-1414 --&gt;
&lt;/table&gt;</summary>
		<author><name>TransEmo</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.abidanarchive.com/index.php?title=Module:Lang/utilities&amp;diff=1413&amp;oldid=prev</id>
		<title>w&gt;Trappist the monk at 23:37, 2 October 2019</title>
		<link rel="alternate" type="text/html" href="https://wiki.abidanarchive.com/index.php?title=Module:Lang/utilities&amp;diff=1413&amp;oldid=prev"/>
		<updated>2019-10-02T23:37:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require ('Module:No globals');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; I S _ C J K &amp;gt;------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
return true if code is one of the listed Chinese, Japanese, Korean ISO 639 codes, false else.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function is_cjk_code (code)&lt;br /&gt;
local cjk =&lt;br /&gt;
		{&lt;br /&gt;
		['zh'] = true, ['cdo'] = true, ['cjy'] = true, ['cmn'] = true,			-- Chinese language codes&lt;br /&gt;
		['cpi'] = true, ['cpx'] = true, ['czh'] = true, ['czo'] = true,&lt;br /&gt;
		['gan'] = true, ['hak'] = true, ['hsn'] = true, ['ltc'] = true,&lt;br /&gt;
		['lzh'] = true, ['mnp'] = true, ['nan'] = true, ['och'] = true,&lt;br /&gt;
		['wuu'] = true, ['yue'] = true, ['zhx'] = true,&lt;br /&gt;
		['ja'] = true, ['jpx'] = true, ['ojp'] = true,							-- Japanese language codes&lt;br /&gt;
		['ko'] = true, ['okm'] = true, ['oko'] = true,							-- Korean language codes&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	return cjk[code] or false;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S E T _ I T A L I C S &amp;gt;--------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Created for use with Template:Infobox book and Template:Infobox document and perhaps others to replace hard-coded&lt;br /&gt;
italic markup in the call to {{lang}}.  This module attempts to make sure that {{lang}} correctly applies italic&lt;br /&gt;
markup according to MOS:FOREIGNITALIC.  &lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function set_italics (frame)&lt;br /&gt;
	local code = frame.args[1] or frame.args['code'] or '';						-- empty string causes 'yes' return; {{lang}} will handle the missing code error&lt;br /&gt;
	local text = frame.args[2] or frame.args['text'] or '';						-- empty string causes 'yes' return; {{lang}} will handle the missing text error&lt;br /&gt;
	&lt;br /&gt;
	local is_latn = require (&amp;quot;Module:Unicode data&amp;quot;).is_Latin;&lt;br /&gt;
	&lt;br /&gt;
	if is_cjk_code (code) and not is_latn (text) then							-- is_latn() is in Module:Lang&lt;br /&gt;
		return  'no';															-- only case for 'no' &lt;br /&gt;
	end&lt;br /&gt;
	return 'yes';																-- everything else is yes&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; I N _ L A N G &amp;gt;----------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
implements {{in lang}}&lt;br /&gt;
&lt;br /&gt;
Module entry point from an {{#invoke:lang/utilities/sanbox|in_lang|&amp;lt;code&amp;gt;|&amp;lt;code2&amp;gt;|&amp;lt;code3&amp;gt;|&amp;lt;code...&amp;gt;|link=yes|template=Link language}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;languageicon&amp;quot;&amp;gt;(in &amp;lt;language&amp;gt;)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function in_lang (frame)&lt;br /&gt;
	local getArgs = require ('Module:Arguments').getArgs;&lt;br /&gt;
	local args = getArgs(frame);&lt;br /&gt;
	local list = {};&lt;br /&gt;
	local cats = {};&lt;br /&gt;
	&lt;br /&gt;
	if not args[1] then&lt;br /&gt;
		local template = (args['template'] and table.concat ({'{{', args['template'], '}}: '})) or '';	-- make template name (if provided by the template)&lt;br /&gt;
		return table.concat ({'&amp;lt;span style=\&amp;quot;font-size:100%; font-style:normal;\&amp;quot; class=\&amp;quot;error\&amp;quot;&amp;gt;error: ', template, 'missing language tag&amp;lt;/span&amp;gt;'});&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local module = 'Module:Lang' .. (frame:getTitle():match ('/sandbox') or '');	-- if this module is the sandbox,&lt;br /&gt;
	local name_from_code = require (module)._name_from_code;						-- use Module:Lang/sandbox; Module:Lang else&lt;br /&gt;
&lt;br /&gt;
	local namespace = mw.title.getCurrentTitle().namespace;						-- used for categorization&lt;br /&gt;
	local this_wiki_lang = mw.getCurrentFrame():preprocess('{{int:lang}}');&lt;br /&gt;
		if '⧼lang⧽' == this_wiki_lang then&lt;br /&gt;
			this_wiki_lang = mw.language.getContentLanguage().code;				-- not at a MediaWiki site that supports interface language; get this wiki's language code&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	for i, lang in ipairs (args) do&lt;br /&gt;
		local t = {args[i], ['link'] = args['link'], ['template'] = args['template']};	-- build an 'args' table&lt;br /&gt;
		lang = name_from_code (t)												-- get the language name&lt;br /&gt;
		table.insert (list, lang)												-- add this language or error message to the list&lt;br /&gt;
&lt;br /&gt;
		if lang:find ('error') or (this_wiki_lang == args[i]) or (0 ~= namespace) then	-- for these, no categorization&lt;br /&gt;
		else&lt;br /&gt;
			if lang:match ('%[%[.-|.-%]%]') then								-- wikilinked individual language&lt;br /&gt;
				lang = lang:match ('%[%[.-|(.-)%]%]');&lt;br /&gt;
			elseif lang:match ('%[%[.-%]%]') then								-- wikilinked collective languages&lt;br /&gt;
				lang = lang:match ('%[%[(.-)%]%]');&lt;br /&gt;
			end																	-- neither of these then plain text language&lt;br /&gt;
&lt;br /&gt;
			if lang:find ('languages') then&lt;br /&gt;
				table.insert (cats, table.concat ({'[[Category:Articles with ', lang, '-collective sources (', args[i], ')]]'}));&lt;br /&gt;
			else&lt;br /&gt;
				table.insert (cats, table.concat ({'[[Category:Articles with ', lang, '-language sources (', args[i], ')]]'}));&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local result = {'&amp;lt;span class=&amp;quot;languageicon&amp;quot;&amp;gt;('};							-- opening span and (&lt;br /&gt;
	table.insert (result, 'yes' == args['cap'] and 'In ' or 'in ');				-- add capitalized or uncapitalized 'in'&lt;br /&gt;
	table.insert (result, mw.text.listToText (list, ', ', (2 &amp;lt; #list) and ', and ' or ' and ' ));	-- add concatenated the language list&lt;br /&gt;
&lt;br /&gt;
	table.insert (result, ')&amp;lt;/span&amp;gt;');											-- add closing ) and closing span&lt;br /&gt;
	table.insert (result, table.concat (cats));									-- add categories&lt;br /&gt;
	return table.concat (result);												-- make a big string and done&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; E X P O R T E D   F U N C T I O N S &amp;gt;------------------------------------------&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	in_lang = in_lang,&lt;br /&gt;
	set_italics = set_italics,&lt;br /&gt;
	}&lt;/div&gt;</summary>
		<author><name>w&gt;Trappist the monk</name></author>
		
	</entry>
</feed>