<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://compusofia.com/w/index.php?action=history&amp;feed=atom&amp;title=Template%3APagelang%2Fdoc</id>
	<title>Template:Pagelang/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://compusofia.com/w/index.php?action=history&amp;feed=atom&amp;title=Template%3APagelang%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://compusofia.com/w/index.php?title=Template:Pagelang/doc&amp;action=history"/>
	<updated>2026-04-19T03:18:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://compusofia.com/w/index.php?title=Template:Pagelang/doc&amp;diff=2211&amp;oldid=prev</id>
		<title>Majestix: 1 revision imported: Initial Setup</title>
		<link rel="alternate" type="text/html" href="https://compusofia.com/w/index.php?title=Template:Pagelang/doc&amp;diff=2211&amp;oldid=prev"/>
		<updated>2026-04-10T16:45:41Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported: Initial Setup&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:45, 10 April 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikiNonStop:diff:1.41:old-2210:rev-2211 --&gt;
&lt;/table&gt;</summary>
		<author><name>Majestix</name></author>
	</entry>
	<entry>
		<id>https://compusofia.com/w/index.php?title=Template:Pagelang/doc&amp;diff=2210&amp;oldid=prev</id>
		<title>en&gt;Eduardogobi: +pt-br</title>
		<link rel="alternate" type="text/html" href="https://compusofia.com/w/index.php?title=Template:Pagelang/doc&amp;diff=2210&amp;oldid=prev"/>
		<updated>2025-04-21T02:06:56Z</updated>

		<summary type="html">&lt;p&gt;+pt-br&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Languages|Template:Pagelang/doc}}&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
{{Languages|Template:Pagelang}}&amp;lt;/includeonly&amp;gt;{{Documentation subpage}}&lt;br /&gt;
{{High-use|50000}}&lt;br /&gt;
{{Lua|Module:Template translation}}&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;templatedata&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;description&amp;quot;: {&lt;br /&gt;
		&amp;quot;en&amp;quot;: &amp;quot;This stuff template for check language of translated subpage (for translatable pages). Used for automate substitution localized values that will match the language of the current page. Also used to help defining text direction (with using with {{dir}}). It is designed to be called from other templates.&amp;quot;,&lt;br /&gt;
		&amp;quot;cs&amp;quot;: &amp;quot;Tato šablona pro kontrolu jazyka přeložené podstránky (pro přeložitelné stránky). Používá se k automatickému nahrazování lokalizovaných hodnot, které budou odpovídat jazyku aktuální stránky. Také se používá k definování směru textu (s použitím s {{dir}}). Je navržen pro volání z jiných šablon.&amp;quot;,&lt;br /&gt;
		&amp;quot;tr&amp;quot;: &amp;quot;Çevrilen alt sayfanın kontrol dili için malzeme şablonu (çevrilebilir sayfalar için). Geçerli sayfanın diliyle eşleşecek yerelleştirilmiş değiştirme değerlerini otomatikleştirmek için kullanılır. Ayrıca metin yönünü tanımlamaya yardımcı olmak için de kullanılır ({{dir}} ile birlikte). Diğer şablonlardan çağrılmak üzere tasarlanmıştır.&amp;quot;,&lt;br /&gt;
		&amp;quot;fr&amp;quot;: &amp;quot;Ce modèle sert à contrôler la langue de la sous-page traduite (pour les pages traductibles). Il est utilisé pour la substitution automatique des valeurs localisées correspondant à la langue de la page actuelle. Il est également utilisé pour aider à définir la direction du texte (par l&amp;#039;utilisation de {{dir}}). Il est conçu pour être appelé à partir d&amp;#039;autres modèles.&amp;quot;,&lt;br /&gt;
		&amp;quot;pt-br&amp;quot;: &amp;quot;Predefinição utilizada para verificar o idioma da subpágina de tradução (para páginas traduzíveis). Usada para automatizar a substituição de valores localizados (traduzidos) que corresponderão ao idioma da página em questão. Usada também para auxiliar na definição da direção do texto (se chamada com {{dir}}). Feita para ser chamada a partir de outras predefinições.&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	&amp;quot;format&amp;quot;: &amp;quot;inline&amp;quot;,&lt;br /&gt;
	&amp;quot;params&amp;quot;: {&lt;br /&gt;
		&amp;quot;1&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: {&lt;br /&gt;
				&amp;quot;en&amp;quot;: &amp;quot;Page title&amp;quot;,&lt;br /&gt;
				&amp;quot;cs&amp;quot;: &amp;quot;Název stránky&amp;quot;,&lt;br /&gt;
				&amp;quot;tr&amp;quot;: &amp;quot;Sayfa başlığı&amp;quot;,&lt;br /&gt;
				&amp;quot;fr&amp;quot;: &amp;quot;Titre de la page&amp;quot;,&lt;br /&gt;
				&amp;quot;pt-br&amp;quot;: &amp;quot;Título da página&amp;quot;&lt;br /&gt;
			},&lt;br /&gt;
			&amp;quot;description&amp;quot;: {&lt;br /&gt;
				&amp;quot;en&amp;quot;: &amp;quot;Page title to get language for. By default the title of the current page.&amp;quot;,&lt;br /&gt;
				&amp;quot;cs&amp;quot;: &amp;quot;Název stránky pro získání jazyka. Ve výchozím nastavení název aktuální stránky.&amp;quot;,&lt;br /&gt;
				&amp;quot;tr&amp;quot;: &amp;quot;Dili alınacak sayfa başlığı. Varsayılan olarak mevcut sayfanın başlığı.&amp;quot;,&lt;br /&gt;
				&amp;quot;fr&amp;quot;: &amp;quot;Titre de la page dont on veut connaître la langue. &amp;quot;,&lt;br /&gt;
				&amp;quot;pt-br&amp;quot;: &amp;quot;Título da página de onde obter-se o idioma. Por padrão, é o título da página atual.&amp;quot;&lt;br /&gt;
			},&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;wiki-page-name&amp;quot;,&lt;br /&gt;
			&amp;quot;default&amp;quot;: {&lt;br /&gt;
				&amp;quot;fr&amp;quot;: &amp;quot;valeur du titre de la page courante.&amp;quot;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/templatedata&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
* &amp;lt;syntaxhighlight inline lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{Pagelang}}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Pagelang}}&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;syntaxhighlight inline lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{Pagelang|Page name}}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Pagelang|Page name}}&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;syntaxhighlight inline lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{Pagelang|Page name/ja}}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Pagelang|Page name/ja}}&lt;br /&gt;
&lt;br /&gt;
Examples of common use in translated pages or templates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
Display the language name of the given the language code in parameter 1, in the same language as the current translated page with a tooltip showing the language name in the user&amp;#039;s preferred language.&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&amp;lt;span lang=&amp;quot;{{#bcp47:{{int:lang}}}}&amp;quot; title=&amp;quot;{{#language:{{1}}|{{int:lang}}}} ({{{1}}})&amp;quot;&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span lang=&amp;quot;{{#bcp47:{{pagelang}}}}&amp;quot; dir=&amp;quot;{{#dir:{{pagelang}}}}&amp;quot; class=&amp;quot;autonym&amp;quot;&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#language:{{1}}|{{pagelang}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
Align the floatting image to the correct side, depending on the language of the current translated page&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;[[File:Example|{{dir|{{pagelang}}|left|right}}|30x30px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Technical note ==&lt;br /&gt;
&lt;br /&gt;
When a subpage page contains any (single or double) quotes or ampersands, it is not a valid language code; &amp;lt;code&amp;gt;PAGENAME&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SUBPAGENAME&amp;lt;/code&amp;gt; normally HTML-encodes these characters in their return value, so they are safe to use as input of &amp;lt;code&amp;gt;#language&amp;lt;/code&amp;gt;. But &amp;lt;code&amp;gt;#titleparts&amp;lt;/code&amp;gt; restores these quotes or ampersands by HTML-decoding them.&lt;br /&gt;
&lt;br /&gt;
But then &amp;lt;syntaxhighlight inline lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{#language:}}&amp;lt;/syntaxhighlight&amp;gt; will produce a fatal server error when it is used with &amp;quot;language codes&amp;quot; with single quotes.&lt;br /&gt;
&lt;br /&gt;
; Proof&lt;br /&gt;
&lt;br /&gt;
This still works:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
  {{#language:fr|{{#titleparts:There&amp;#039;s a fatal bug in MediaWiki|1}}}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not work either:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
  {{#language:fr|{{PAGENAME:There&amp;#039;s a fatal bug in MediaWiki}}}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nor does this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
  {{#language:fr|There&amp;#039;s a fatal bug in MediaWiki}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;error&amp;quot;&amp;gt;This is a critical bug of the &amp;lt;syntaxhighlight inline lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{#language:}}&amp;lt;/syntaxhighlight&amp;gt; parser function, and apparently a severe security issues that could be caused by some clever insertion of code in PHP after the quote.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This bug only occurs in the second parameter of &amp;lt;syntaxhighlight inline lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{#language:}}&amp;lt;/syntaxhighlight&amp;gt; (the target language into which to give the name of the language specified by the code in the first parameter). Only the first parameter is checked for validity, but not the second one. Here, where &amp;lt;syntaxhighlight inline lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{#language:}}&amp;lt;/syntaxhighlight&amp;gt; cannot find the name of the language, in any target language, it should return the native language name, as in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
  {{#language:fr|invalid language}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
:  {{#language:fr|invalid language}}&lt;br /&gt;
&lt;br /&gt;
; Work-around used in this template&lt;br /&gt;
&lt;br /&gt;
To avoid this severe bug, we want to detect quotes (or ampersands) in subpage names, as they are invalid anyway in any language code, in order to return an empty string and not the subpage name: such subpage name cannot be a language code anyway.&lt;br /&gt;
&lt;br /&gt;
One way to detect subpages that cannot be safe language codes is to check if their value filtered by &amp;lt;syntaxhighlight inline lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{#titleparts:}}&amp;lt;/syntaxhighlight&amp;gt; is equal to their value filtered by &amp;lt;syntaxhighlight inline lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{PAGENAME}}&amp;lt;/syntaxhighlight&amp;gt;: if they aren&amp;#039;t equal that&amp;#039;s because they contained &amp;quot;ampersands&amp;quot;, or quotes.&lt;br /&gt;
&lt;br /&gt;
; Why we use &amp;lt;syntaxhighlight inline lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{#titleparts:}}&amp;lt;/syntaxhighlight&amp;gt; and not just &amp;lt;syntaxhighlight inline lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{SUBPAGENAME}}&amp;lt;/syntaxhighlight&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight inline lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{#titleparts:}}&amp;lt;/syntaxhighlight&amp;gt; is used in this template instead of using &amp;lt;syntaxhighlight inline lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{SUBPAGENAME}}&amp;lt;/syntaxhighlight&amp;gt;, but using &amp;lt;code&amp;gt;SUBPAGENAME&amp;lt;/code&amp;gt; would not avoid the bug either, because it could as well return the full page name containing the quotes (&amp;lt;syntaxhighlight inline lang=&amp;quot;wikitext&amp;quot;&amp;gt;{{SUBPAGENAME}}&amp;lt;/syntaxhighlight&amp;gt; only works in namespaces where subpages have been activated, so it does not work in the main namespace to see if it has been translated using a language code suffix).&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* {{ll|Manual:PAGENAMEE encoding}}&lt;br /&gt;
* {{tl|TNT}}&lt;br /&gt;
* {{tl|LL}}&lt;br /&gt;
* {{tl|BCP47}}&lt;br /&gt;
* {{tl|dir}}&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
[[Category:Internationalization templates{{#translation:}}]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>en&gt;Eduardogobi</name></author>
	</entry>
</feed>