<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://bsd.neuroinf.jp/w/index.php?action=history&amp;feed=atom&amp;title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%3AWikidata_label</id>
	<title>モジュール:Wikidata label - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://bsd.neuroinf.jp/w/index.php?action=history&amp;feed=atom&amp;title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%3AWikidata_label"/>
	<link rel="alternate" type="text/html" href="https://bsd.neuroinf.jp/w/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Wikidata_label&amp;action=history"/>
	<updated>2026-04-17T23:22:22Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://bsd.neuroinf.jp/w/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Wikidata_label&amp;diff=48076&amp;oldid=prev</id>
		<title>WikiSysop: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://bsd.neuroinf.jp/w/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Wikidata_label&amp;diff=48076&amp;oldid=prev"/>
		<updated>2023-05-08T00:09:07Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2023年5月8日 (月) 09:09時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wiki-mw_:diff:1.41:old-48075:rev-48076 --&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://bsd.neuroinf.jp/w/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Wikidata_label&amp;diff=48075&amp;oldid=prev</id>
		<title>bsd&gt;WOSlinker: use require(&#039;strict&#039;) instead of require(&#039;Module:No globals&#039;)</title>
		<link rel="alternate" type="text/html" href="https://bsd.neuroinf.jp/w/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Wikidata_label&amp;diff=48075&amp;oldid=prev"/>
		<updated>2022-10-30T13:19:50Z</updated>

		<summary type="html">&lt;p&gt;use require(&amp;#039;strict&amp;#039;) instead of require(&amp;#039;Module:No globals&amp;#039;)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2022年10月30日 (日) 22:19時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l17&quot;&gt;17行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;17行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;require(&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Module:No globals&lt;/del&gt;&#039;) -- used for debugging purposes as it detects cases of unintended global variables&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;require(&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;strict&lt;/ins&gt;&#039;) -- used for debugging purposes as it detects cases of unintended global variables&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;--=============================================&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;--=============================================&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l125&quot;&gt;125行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;125行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-- INPUTS:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-- INPUTS:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;--  * label - label string&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;--  * label - label string&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;--  * capitalization - capitalization to be applied: allowed values are &quot;lc&quot;,&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;--  * capitalization - capitalization to be applied: allowed values are &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;tc&quot;, &lt;/ins&gt;&quot;lc&quot;,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;--      &amp;quot;uc&amp;quot;, &amp;quot;lcfirst&amp;quot;, and &amp;quot;ucfirst&amp;quot;. Any other value will return original string&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;--      &amp;quot;uc&amp;quot;, &amp;quot;lcfirst&amp;quot;, and &amp;quot;ucfirst&amp;quot;. Any other value will return original string&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;--  * lang - language of the label&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;--  * lang - language of the label&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l135&quot;&gt;135行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;135行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		return label&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		return label&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	elseif capitalization == &amp;#039;uc&amp;#039; then&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	elseif capitalization == &amp;#039;uc&amp;#039; then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		return mw.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ustring&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;upper&lt;/del&gt;(label)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		return mw.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;language&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;new(lang):uc(label)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	elseif capitalization == &#039;lc&#039; then&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		return mw.language.new(lang):lc&lt;/ins&gt;(label&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	elseif capitalization == &#039;tc&#039; then -- title case&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		local new_label = {}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		for _, word in ipairs(mw.text.split(label, &#039; &#039;)) do&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;			table.insert(new_label, mw.language.new(lang):ucfirst(word))	&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		return table.concat(new_label, &#039; &#039;&lt;/ins&gt;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	elseif capitalization == &amp;#039;ucfirst&amp;#039; then&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	elseif capitalization == &amp;#039;ucfirst&amp;#039; then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		return mw.language.new(lang):ucfirst(label)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		return mw.language.new(lang):ucfirst(label)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	elseif capitalization == &#039;lc&#039; then&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		return mw.ustring.lower(label)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	elseif capitalization == &amp;#039;lcfirst&amp;#039; then&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	elseif capitalization == &amp;#039;lcfirst&amp;#039; then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		return mw.language.new(lang):lcfirst(label)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		return mw.language.new(lang):lcfirst(label)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l251&quot;&gt;251行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;257行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;function p._getLabel(item, lang, link_type, capitalization, show_id)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;function p._getLabel(item, lang, link_type, capitalization, show_id)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	local entity, s, link, label, language&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	local entity, s, link, label, language&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, desc&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	-- clean up the input parameters&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	-- clean up the input parameters&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l285&quot;&gt;285行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;291行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			if label then break end                    -- label found and we are done&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			if label then break end                    -- label found and we are done&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	if label then  -- wikitext-escape the label if we have one&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		label = mw.text.nowiki(label)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	if not label then                              -- no labels found, so just show the q-id&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	if not label then                              -- no labels found, so just show the q-id&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l298&quot;&gt;298行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;307行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	label = apply_capitalization(label, capitalization, lang)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	label = apply_capitalization(label, capitalization, lang)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	-- look for description&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	if  entity and entity.descriptions and lang then &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		for _, language in ipairs(langList) do&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;			if entity.descriptions[language] then&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;				desc = entity.descriptions[language].value &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;				break&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;			end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	else&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		desc = mw.wikibase.getDescription(item)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	if desc and link_type ~= &#039;-&#039; then  -- wikitext-escape the description if we have one&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		desc = mw.text.nowiki(desc) -- add description as hover text&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		label = &#039;&amp;lt;span title=&quot;&#039; .. desc .. &#039;&quot;&amp;gt;&#039; .. label .. &#039;&amp;lt;/span&amp;gt;&#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	-- return the results&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	-- return the results&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l424&quot;&gt;424行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;449行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	2: language (optional; default {{int:lang}})&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	2: language (optional; default {{int:lang}})&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	3: link_style: &amp;quot;wikipedia&amp;quot; (default), &amp;quot;Wikidata&amp;quot;, &amp;quot;Commons&amp;quot;, or &amp;quot;-&amp;quot; (no link)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	3: link_style: &amp;quot;wikipedia&amp;quot; (default), &amp;quot;Wikidata&amp;quot;, &amp;quot;Commons&amp;quot;, or &amp;quot;-&amp;quot; (no link)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	4: capitalization - can be &quot;uc&quot;, &quot;lc&quot;, &quot;ucfirst&quot;, &quot;lcfirst&quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	4: capitalization - can be &quot;uc&quot;, &quot;lc&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;, &quot;tc&lt;/ins&gt;&quot;, &quot;ucfirst&quot;, &quot;lcfirst&quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Error Handling:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Error Handling:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>bsd&gt;WOSlinker</name></author>
	</entry>
	<entry>
		<id>https://bsd.neuroinf.jp/w/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Wikidata_label&amp;diff=44430&amp;oldid=prev</id>
		<title>WikiSysop: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://bsd.neuroinf.jp/w/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Wikidata_label&amp;diff=44430&amp;oldid=prev"/>
		<updated>2020-07-25T12:24:14Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2020年7月25日 (土) 21:24時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wiki-mw_:diff:1.41:old-44429:rev-44430 --&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://bsd.neuroinf.jp/w/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Wikidata_label&amp;diff=44429&amp;oldid=prev</id>
		<title>bsd&gt;Jarekt: restore old style links to wikidata items d:Qxxx instead of d:Special:EntityPage/Qxxx</title>
		<link rel="alternate" type="text/html" href="https://bsd.neuroinf.jp/w/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Wikidata_label&amp;diff=44429&amp;oldid=prev"/>
		<updated>2020-05-27T02:26:33Z</updated>

		<summary type="html">&lt;p&gt;restore old style links to wikidata items &lt;a href=&quot;https://www.wikidata.org/wiki/Qxxx&quot; class=&quot;extiw&quot; title=&quot;d:Qxxx&quot;&gt;d:Qxxx&lt;/a&gt; instead of &lt;a href=&quot;https://www.wikidata.org/wiki/Special:EntityPage/Qxxx&quot; class=&quot;extiw&quot; title=&quot;d:Special:EntityPage/Qxxx&quot;&gt;d:Special:EntityPage/Qxxx&lt;/a&gt;&lt;/p&gt;
&lt;a href=&quot;https://bsd.neuroinf.jp/w/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Wikidata_label&amp;amp;diff=44429&amp;amp;oldid=43625&quot;&gt;差分を表示&lt;/a&gt;</summary>
		<author><name>bsd&gt;Jarekt</name></author>
	</entry>
	<entry>
		<id>https://bsd.neuroinf.jp/w/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Wikidata_label&amp;diff=43625&amp;oldid=prev</id>
		<title>Nijcadmin: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://bsd.neuroinf.jp/w/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Wikidata_label&amp;diff=43625&amp;oldid=prev"/>
		<updated>2020-01-29T04:27:50Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2020年1月29日 (水) 13:27時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wiki-mw_:diff:1.41:old-43624:rev-43625 --&gt;
&lt;/table&gt;</summary>
		<author><name>Nijcadmin</name></author>
	</entry>
	<entry>
		<id>https://bsd.neuroinf.jp/w/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Wikidata_label&amp;diff=43624&amp;oldid=prev</id>
		<title>bsd&gt;Jarekt: fix https://phabricator.wikimedia.org/T240563</title>
		<link rel="alternate" type="text/html" href="https://bsd.neuroinf.jp/w/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Wikidata_label&amp;diff=43624&amp;oldid=prev"/>
		<updated>2019-12-12T19:03:14Z</updated>

		<summary type="html">&lt;p&gt;fix https://phabricator.wikimedia.org/T240563&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[  &lt;br /&gt;
  __  __           _       _      __        ___ _    _     _       _          _       _          _ &lt;br /&gt;
 |  \/  | ___   __| |_   _| | ___ \ \      / (_) | _(_) __| | __ _| |_ __ _  | | __ _| |__   ___| |&lt;br /&gt;
 | |\/| |/ _ \ / _` | | | | |/ _ (_) \ /\ / /| | |/ / |/ _` |/ _` | __/ _` | | |/ _` | &amp;#039;_ \ / _ \ |&lt;br /&gt;
 | |  | | (_) | (_| | |_| | |  __/_ \ V  V / | |   &amp;lt;| | (_| | (_| | || (_| | | | (_| | |_) |  __/ |&lt;br /&gt;
 |_|  |_|\___/ \__,_|\__,_|_|\___(_) \_/\_/  |_|_|\_\_|\__,_|\__,_|\__\__,_| |_|\__,_|_.__/ \___|_|&lt;br /&gt;
                                                                                                   &lt;br /&gt;
This module is intended to be the engine behind &amp;quot;Template:Label&amp;quot;.&lt;br /&gt;
Thic module was copied from Commons please ask for changes there.&lt;br /&gt;
&lt;br /&gt;
Please do not modify this code without applying the changes first at &amp;quot;Module:Wikidata label/sandbox&amp;quot; and testing &lt;br /&gt;
at &amp;quot;Module:Wikidata label/testcases&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Authors and maintainers:&lt;br /&gt;
* User:Jarekt - original version &lt;br /&gt;
&lt;br /&gt;
Dependencies:&lt;br /&gt;
* Module:Yesno - used only if &amp;quot;show_id&amp;quot; parameter present&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
-- use different sitelink call depending if you already have an entity or not&lt;br /&gt;
local function getSitelink(item, entity, lang)&lt;br /&gt;
	if entity and entity.getSitelink then -- if we have entity than use it&lt;br /&gt;
		return entity:getSitelink(lang .. &amp;#039;wiki&amp;#039;) &lt;br /&gt;
	else -- if no entity than use different function&lt;br /&gt;
		return mw.wikibase.sitelink( item, lang .. &amp;#039;wiki&amp;#039; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
_getLabel&lt;br /&gt;
&lt;br /&gt;
This function returns a label translated to desired language, created based on wikidata&lt;br /&gt;
&lt;br /&gt;
Inputs:&lt;br /&gt;
	1: item - wikidata&amp;#039;s item&amp;#039;s q-code or entity class&lt;br /&gt;
	2: lang - desired language of the label&lt;br /&gt;
	3: link_type - link style. Possible values: &amp;quot;wikipedia&amp;quot;, &amp;quot;Wikidata&amp;quot;, &amp;quot;Commons&amp;quot;, or &amp;quot;-&amp;quot; (no link)&lt;br /&gt;
	4: capitalization - can be &amp;quot;uc&amp;quot; (upper case), &amp;quot;lc&amp;quot; (lower case), &amp;quot;ucfirst&amp;quot; (upper case for the first letter), &lt;br /&gt;
			&amp;quot;lcfirst&amp;quot; (lower case for the first letter)&lt;br /&gt;
 &lt;br /&gt;
Error Handling:&lt;br /&gt;
	Bad q-code will result in displayed error&lt;br /&gt;
]]&lt;br /&gt;
function p._getLabel(item, lang, link_type, capitalization, show_id)&lt;br /&gt;
	local entity, s, link, label, language&lt;br /&gt;
&lt;br /&gt;
	-- clean up the input parameters&lt;br /&gt;
	if type(item)~=&amp;#039;string&amp;#039; then -- &amp;quot;item&amp;quot; is not a q-code&lt;br /&gt;
		entity = item            -- &amp;quot;item&amp;quot; must be the entity&lt;br /&gt;
		item   = entity.id       -- look-up q-code&lt;br /&gt;
	elseif tonumber(item) then   -- if it is just the number than add &amp;quot;Q&amp;quot; in front&lt;br /&gt;
		item = &amp;#039;Q&amp;#039;..item&lt;br /&gt;
	end&lt;br /&gt;
	item = string.gsub( string.upper(item), &amp;#039;PROPERTY:P&amp;#039;, &amp;#039;P&amp;#039;) -- make all the properties the same and capitalize&lt;br /&gt;
	&lt;br /&gt;
	-- build language fallback list&lt;br /&gt;
	lang = string.lower(lang) or &amp;#039;en&amp;#039;&lt;br /&gt;
	local langList = mw.language.getFallbacksFor(lang)&lt;br /&gt;
	table.insert(langList, 1, lang)&lt;br /&gt;
	&lt;br /&gt;
	-- get label (visible part of the link)&lt;br /&gt;
	for _, language in ipairs(langList) do  -- loop over language fallback list looking for label in the specific language&lt;br /&gt;
		if entity then&lt;br /&gt;
			label = entity:getLabel(language)&lt;br /&gt;
		else&lt;br /&gt;
			label = mw.wikibase.getLabelByLang(item, language)&lt;br /&gt;
		end&lt;br /&gt;
		if label then break end                    -- label found and we are done&lt;br /&gt;
	end&lt;br /&gt;
	if not label then                              -- no labels found, so just show the q-code&lt;br /&gt;
		label = item&lt;br /&gt;
	elseif show_id then           -- add id&lt;br /&gt;
		local yesno = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
		show_id = yesno(show_id,false)&lt;br /&gt;
		if show_id then &lt;br /&gt;
			local id = mw.getCurrentFrame():preprocess( &amp;quot;{{int:parentheses|&amp;quot; .. item ..&amp;quot;}}&amp;quot;)&lt;br /&gt;
			local wordsep  = mw.message.new( &amp;quot;Word-separator&amp;quot; ):inLanguage(lang):plain()&lt;br /&gt;
			label = label .. wordsep .. &amp;quot;&amp;lt;small&amp;gt;&amp;quot; .. id .. &amp;quot;&amp;lt;/small&amp;gt;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- change capitalization of the label&lt;br /&gt;
	if capitalization==&amp;#039;ucfirst&amp;#039; then&lt;br /&gt;
		label = mw.language.new(lang):ucfirst(label)&lt;br /&gt;
	elseif capitalization==&amp;#039;lcfirst&amp;#039; then&lt;br /&gt;
		label = mw.language.new(lang):lcfirst(label)&lt;br /&gt;
	elseif capitalization==&amp;#039;uc&amp;#039; then&lt;br /&gt;
		label = mw.language.new(lang):uc(label)&lt;br /&gt;
	elseif capitalization==&amp;#039;lc&amp;#039; then&lt;br /&gt;
		label = mw.language.new(lang):lc(label)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- create URL part of the link&lt;br /&gt;
	link_type = string.lower(link_type or &amp;#039;&amp;#039;)&lt;br /&gt;
	local dLink = &amp;#039;d:&amp;#039;..item; -- create fallback wikidata link&lt;br /&gt;
	local item_type = string.sub(item, 1, 1) -- item&amp;#039;s first letter:Q, P or M&lt;br /&gt;
	if item_type == &amp;#039;P&amp;#039; then&lt;br /&gt;
		dLink = &amp;#039;d:Property:&amp;#039;.. item&lt;br /&gt;
	elseif item_type == &amp;#039;M&amp;#039; then&lt;br /&gt;
		dLink = &amp;#039;Special:Redirect/page/&amp;#039; .. string.sub(item, 2)&lt;br /&gt;
	end&lt;br /&gt;
	if link_type==&amp;#039;-&amp;#039; then -- allow different link formats&lt;br /&gt;
		link = &amp;#039;&amp;#039;            -- no link&lt;br /&gt;
	elseif link_type==&amp;#039;wikidata&amp;#039; or item_type==&amp;#039;M&amp;#039; then&lt;br /&gt;
		link = dLink         -- link to wikibase page&lt;br /&gt;
	elseif link_type==&amp;#039;wikidata talk&amp;#039; and item_type==&amp;#039;P&amp;#039; then&lt;br /&gt;
		link = &amp;#039;d:Property talk:&amp;#039;.. item        -- link to wikidata property talk page&lt;br /&gt;
	elseif link_type==&amp;#039;wikidata talk&amp;#039; then&lt;br /&gt;
		link = &amp;#039;d:Talk:&amp;#039;..item         -- link to wikidata talk page&lt;br /&gt;
	elseif link_type==&amp;#039;commons&amp;#039; or link_type==&amp;#039;commonscat&amp;#039; then&lt;br /&gt;
		-- For link_type==&amp;#039;commons&amp;#039; we try the following links (in that order): &lt;br /&gt;
		--   1) sitelink to commons &lt;br /&gt;
		--   2) &amp;quot;Commons Category&amp;quot; P373 property &lt;br /&gt;
		--   3) &amp;quot;Commons Gallery&amp;quot;  P935 property&lt;br /&gt;
		-- Since most pages have a sitelink to commons we never have to call expensive mw.wikibase.getEntity&lt;br /&gt;
		-- For link_type==&amp;#039;commonscat&amp;#039; we try to maximize chances of commons link beeing a category, so we &lt;br /&gt;
		--       try the following links (in that order): &lt;br /&gt;
		--   1) sitelink to commons, which is kept if it points to a category&lt;br /&gt;
		--   2) &amp;quot;Commons Category&amp;quot; P373 property &lt;br /&gt;
		--   3) sitelink to commons (which does not point to a category)&lt;br /&gt;
		--   4) &amp;quot;Commons Gallery&amp;quot;  P935 property&lt;br /&gt;
		-- Since most pages have a sitelink to commons we never have to call expensive mw.wikibase.getEntity&lt;br /&gt;
		local sLink = getSitelink(item, entity, &amp;#039;commons&amp;#039;)  -- look for sitelink to commons&lt;br /&gt;
		if sLink then &lt;br /&gt;
			sLink = &amp;#039;c:&amp;#039;..sLink&lt;br /&gt;
			if (link_type==&amp;#039;commons&amp;#039;) or (link_type==&amp;#039;commonscat&amp;#039; and string.find( sLink, &amp;#039;Category:&amp;#039;)) then&lt;br /&gt;
				link = sLink&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if not link then -- try linking to P373 category&lt;br /&gt;
			-- this is potentially memory expensive operation&lt;br /&gt;
			entity = entity or mw.wikibase.getEntity(item); &lt;br /&gt;
			assert(entity, &amp;quot;Item ID &amp;quot; .. item .. &amp;quot; is not valid&amp;quot;)&lt;br /&gt;
			s = entity:getBestStatements( &amp;#039;P373&amp;#039; )&lt;br /&gt;
			if s[1] and s[1].mainsnak.datavalue.value then &lt;br /&gt;
				 link = &amp;#039;c:Category:&amp;#039; .. s[1].mainsnak.datavalue.value&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		link = link or sLink&lt;br /&gt;
		if not link then -- try linking to P935 gallery&lt;br /&gt;
			-- there is no need for mw.wikibase.getEntity(item) call since at this point it was already loded&lt;br /&gt;
			s = entity:getBestStatements( &amp;#039;P935&amp;#039; )&lt;br /&gt;
			if s[1] and s[1].mainsnak.datavalue.value then &lt;br /&gt;
				 link = s[1].mainsnak.datavalue.value&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if not link then-- apply default &amp;quot;Wikipedia&amp;quot; link type&lt;br /&gt;
		for _, language in ipairs(langList) do &lt;br /&gt;
			local sitelink = getSitelink(item, entity, language)&lt;br /&gt;
			if sitelink then &lt;br /&gt;
				link = mw.ustring.format(&amp;#039;w:%s:%s&amp;#039;, language, sitelink)&lt;br /&gt;
				break &lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	link = link or dLink  -- no wiki sitelink, so link to wikidata&lt;br /&gt;
	&lt;br /&gt;
	-- return the results&lt;br /&gt;
	if link~=&amp;#039;&amp;#039; then&lt;br /&gt;
		return mw.ustring.format(&amp;#039;[[%s|%s]]&amp;#039;, link, label) -- return link&lt;br /&gt;
	else&lt;br /&gt;
		return label -- return just a label&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
getLabel&lt;br /&gt;
 &lt;br /&gt;
This function returns a label translated to desired language, created based on wikidata&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:Wikidata label|getLabel|item=Q...|lang=..|link_style=..|capitalization=..}}&lt;br /&gt;
&lt;br /&gt;
Parameters&lt;br /&gt;
	1: wikidata&amp;#039;s item&amp;#039;s q-code (required)&lt;br /&gt;
	2: language (optional; default {{int:lang}} )&lt;br /&gt;
	3: link_style: &amp;quot;wikipedia&amp;quot; (default), &amp;quot;Wikidata&amp;quot;, &amp;quot;Commons&amp;quot;, or &amp;quot;-&amp;quot; (no link)&lt;br /&gt;
	4: capitalization - can be &amp;quot;uc&amp;quot;, &amp;quot;lc&amp;quot;, &amp;quot;ucfirst&amp;quot;, &amp;quot;lcfirst&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Error Handling:&lt;br /&gt;
	Bad q-code will result in displayed error&lt;br /&gt;
]]&lt;br /&gt;
function p.getLabel(frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	if not (args.lang and mw.language.isSupportedLanguage(args.lang)) then &lt;br /&gt;
		args.lang = frame:callParserFunction( &amp;quot;int&amp;quot;, &amp;quot;lang&amp;quot; ) -- get user&amp;#039;s chosen language &lt;br /&gt;
	end&lt;br /&gt;
	if (not args.link) or (mw.text.trim(args.link) == &amp;quot;&amp;quot;) then&lt;br /&gt;
		args.link = &amp;quot;wikipedia&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if (not args.capitalization) or (mw.text.trim(args.capitalization) == &amp;quot;&amp;quot;) then&lt;br /&gt;
		args.capitalization = &amp;quot;none&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	args.item = mw.text.trim(args.item or &amp;#039;&amp;#039;)&lt;br /&gt;
	return p._getLabel(args.item, args.lang, args.link, args.capitalization, args.show_id)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
_sitelinks&lt;br /&gt;
&lt;br /&gt;
This function returns a table of sitelinks for a single project organized by language&lt;br /&gt;
&lt;br /&gt;
Inputs:&lt;br /&gt;
	1: item - wikidata&amp;#039;s item&amp;#039;s q-code or entity class&lt;br /&gt;
	2: project - &amp;quot;wikipedia&amp;quot;, &amp;quot;wikisource&amp;quot;, &amp;quot;wikiquote&amp;quot;, &amp;quot;wikibooks&amp;quot;, &amp;quot;wikinews&amp;quot;, &amp;quot;wikiversity&amp;quot;, &lt;br /&gt;
			&amp;quot;wikivoyage&amp;quot;, &amp;quot;wiktionary&amp;quot;, &amp;quot;commons&amp;quot;, &amp;quot;mediawiki&amp;quot;, &amp;quot;wikispecies&amp;quot;, &amp;quot;wikidata&amp;quot;,  etc.&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
	Table with language fields&lt;br /&gt;
]]&lt;br /&gt;
function p._sitelinks( item, project )&lt;br /&gt;
	local entity, sitelink&lt;br /&gt;
	-- get entity&lt;br /&gt;
	if type(item)==&amp;#039;string&amp;#039; then -- &amp;quot;item&amp;quot; is a q-code&lt;br /&gt;
		entity = mw.wikibase.getEntity(item); &lt;br /&gt;
	else&lt;br /&gt;
		entity = item            -- &amp;quot;item&amp;quot; is the entity&lt;br /&gt;
		item   = entity.id       -- look-up q-code&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- get project code&lt;br /&gt;
	local LUT = {wikipedia=&amp;#039;wiki&amp;#039;, commons=&amp;#039;commonswiki&amp;#039;, mediawiki=&amp;#039;mediawikiwiki&amp;#039;, wikispecies=&amp;#039;specieswiki&amp;#039;, wikidata=&amp;#039;wikidatawiki&amp;#039;}&lt;br /&gt;
	project = string.lower(project)&lt;br /&gt;
	if LUT[project] then -- correct the project name&lt;br /&gt;
		project=LUT[project]&lt;br /&gt;
	end&lt;br /&gt;
	local n = string.len(project);&lt;br /&gt;
	local s ={}&lt;br /&gt;
	if entity and entity.sitelinks then 					  -- See if entity exists, and that it has sitelinks&lt;br /&gt;
		for _, sitelink in pairs(entity.sitelinks) do 				-- loop over all sitelinks&lt;br /&gt;
		  local site = sitelink.site&lt;br /&gt;
			local lang = mw.ustring.sub( site, 1, mw.ustring.len(site) - n  )  -- language part of the siteID&lt;br /&gt;
			local proj = mw.ustring.sub( site, mw.ustring.len(site) - n + 1 )  -- project part of the siteID&lt;br /&gt;
			if proj == project then -- proj matches desired &amp;quot;project&amp;quot;&lt;br /&gt;
				s[lang] = sitelink.title&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return s&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
sitelinks&lt;br /&gt;
&lt;br /&gt;
This function returns a comma separated list of sitelinks for a single project organized by language&lt;br /&gt;
Its main purpose is to help with testing of _sitelinks function.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:Wikidata label|sitelinks|item=Q...|project=..}}&lt;br /&gt;
&lt;br /&gt;
Inputs:&lt;br /&gt;
	1: item - wikidata&amp;#039;s item&amp;#039;s q-code or entity class&lt;br /&gt;
	2: project - &amp;quot;wikipedia&amp;quot; (or &amp;quot;wiki&amp;quot;), &amp;quot;wikisource&amp;quot;, &amp;quot;wikiquote&amp;quot;, &amp;quot;wikibooks&amp;quot;, &amp;quot;wikinews&amp;quot;, &amp;quot;wikiversity&amp;quot;, &amp;quot;wikivoyage&amp;quot;, &amp;quot;wiktionary&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
	comma separated list&lt;br /&gt;
]]&lt;br /&gt;
function p.sitelinks(frame)&lt;br /&gt;
	local sitelinks = p._sitelinks(frame.args.item, frame.args.project)&lt;br /&gt;
	local s = {}&lt;br /&gt;
	for i, j in pairs(sitelinks) do&lt;br /&gt;
		table.insert(s, i .. &amp;#039;:&amp;#039; .. j)&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(s, &amp;#039;, &amp;#039;)	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
_aliases&lt;br /&gt;
&lt;br /&gt;
This function returns a table of aliases for a single language&lt;br /&gt;
&lt;br /&gt;
Inputs:&lt;br /&gt;
	1: item - wikidata&amp;#039;s item&amp;#039;s q-code or entity class&lt;br /&gt;
	2: lang - language code, like &amp;#039;en&amp;#039; or &amp;#039;de&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
	Table of aliases&lt;br /&gt;
]]&lt;br /&gt;
function p._aliases( item, lang )&lt;br /&gt;
	local entity&lt;br /&gt;
	if type(item)==&amp;#039;string&amp;#039; then -- &amp;quot;item&amp;quot; is a q-code&lt;br /&gt;
		entity = mw.wikibase.getEntity(item); &lt;br /&gt;
	else&lt;br /&gt;
		entity = item            -- &amp;quot;item&amp;quot; is the entity&lt;br /&gt;
		item   = entity.id       -- look-up q-code&lt;br /&gt;
	end&lt;br /&gt;
	local s = {}&lt;br /&gt;
	if entity and entity.aliases then						-- See if there is an entity and that is has aliases&lt;br /&gt;
		if entity.aliases[lang] then						-- See if it has English Aliases&lt;br /&gt;
			for i, j in pairs(entity.aliases[lang]) do		-- Make a loop around the English aliases&lt;br /&gt;
				table.insert(s, j.value)					-- Create a table of English aliases&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return s&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
aliases&lt;br /&gt;
&lt;br /&gt;
This function returns a comma separated list of aliases for a single language&lt;br /&gt;
Its main purpose is to help with testing of _aliases function.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:Wikidata label|aliases|item=Q...|lang=..}}&lt;br /&gt;
&lt;br /&gt;
Inputs:&lt;br /&gt;
	1: item - wikidata&amp;#039;s item&amp;#039;s q-code or entity class&lt;br /&gt;
	2: lang - language code, like &amp;#039;en&amp;#039; or &amp;#039;de&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
	Comma separated list of aliases&lt;br /&gt;
]]&lt;br /&gt;
function p.aliases(frame)&lt;br /&gt;
	return table.concat(p._aliases(frame.args.item, frame.args.lang), &amp;#039;, &amp;#039;)	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>bsd&gt;Jarekt</name></author>
	</entry>
</feed>