Template:Lang: Difference between revisions

From Open Source Ecology
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 12: Line 12:
<li>[[{{NAMESPACE}}:{{BASEPAGENAME}}/he|<span title="עברית">HE</span>]]</li>
<li>[[{{NAMESPACE}}:{{BASEPAGENAME}}/he|<span title="עברית">HE</span>]]</li>
<li>[[{{NAMESPACE}}:{{BASEPAGENAME}}/hi|<span title="हिन्दी">HI</span>]]</li>
<li>[[{{NAMESPACE}}:{{BASEPAGENAME}}/hi|<span title="हिन्दी">HI</span>]]</li>
<li>[[{{NAMESPACE}}:{{BASEPAGENAME}}/hr|<span title="Hrvatski">HR</span>]]</li>
<li>[[{{NAMESPACE}}:{{BASEPAGENAME}}/hu|<span title="Magyar">HU</span>]]</li>
<li>[[{{NAMESPACE}}:{{BASEPAGENAME}}/hu|<span title="Magyar">HU</span>]]</li>
<li>[[{{NAMESPACE}}:{{BASEPAGENAME}}/id|<span title="Indonesian">ID</span>]]</li>
<li>[[{{NAMESPACE}}:{{BASEPAGENAME}}/it|<span title="Italiano">IT</span>]]</li>
<li>[[{{NAMESPACE}}:{{BASEPAGENAME}}/it|<span title="Italiano">IT</span>]]</li>
<li>[[{{NAMESPACE}}:{{BASEPAGENAME}}/ja|<span title="日本語">JA</span>]]</li>
<li>[[{{NAMESPACE}}:{{BASEPAGENAME}}/ja|<span title="日本語">JA</span>]]</li>
Line 51: Line 53:
   | he = [[Category:HE]]
   | he = [[Category:HE]]
   | hi = [[Category:HI]]
   | hi = [[Category:HI]]
  | hr = [[Category:HR]]
   | hu = [[Category:HU]]
   | hu = [[Category:HU]]
   | is = [[Category:IS]]
   | is = [[Category:IS]]
  | id = [[Category:ID]]
   | it = [[Category:IT]]
   | it = [[Category:IT]]
   | ja = [[Category:JA]]
   | ja = [[Category:JA]]

Latest revision as of 05:01, 12 November 2025

Usage

{{Lang|Localised Page Name}}

Documentation

This template should be added to all translated articles in the main namespace. For the source (English) pages, use the second Template Template:OrigLang.

It shows the list of all languages an article should be translated to and also sets the correct, localised display title of the article.

Adding new Languages

Additional languages can easily be added here. You just need to add to lines:

  • put a new language link into the div container (please make sure they are alphabetically ordered):
<li>[[{{NAMESPACE}}:{{BASEPAGENAME}}/hu|HU]]</li>
  • put a new case into the sanityzing switch function which adds the page to the correct category:
| hu = [[Category:HU]]

The subpages will automatically be used by different MediaWiki extensions which detect language settings in browsers or user preferences. The user will then automatically be redirected into the appropriate subpage.

Appearance

The CSS code for the div container of the class "lang" can be adopted in MediaWiki:Common.css.