Difference between revisions of "Template:Languages"

From DMARC Wiki
Jump to navigation Jump to search
m (Protected "Template:Languages": Sitewide and very visible template - require login to edit. [edit=autoconfirmed:move=autoconfirmed])
(Simplified using Template:Languages/Lang, and made the page name optional.)
Line 7: Line 7:
 
'''[[{{{1|{{NAMESPACE}}:{{BASEPAGENAME}}}}}|English]]''' –  
 
'''[[{{{1|{{NAMESPACE}}:{{BASEPAGENAME}}}}}|English]]''' –  
 
Translations:  
 
Translations:  
{{
+
{{Languages/Lang|de|{{{1|}}}}}
#ifexist: {{{1}}}/de | <span lang="de">[[{{{1}}}/de|{{#language:de}}]]</span> &nbsp;&bull;&nbsp;
+
{{Languages/Lang|es|{{{1|}}}}}
}}{{
+
{{Languages/Lang|fi|{{{1|}}}}}
#ifexist: {{{1}}}/es | <span lang="es">[[{{{1}}}/es|{{#language:es}}]]</span> &nbsp;&bull;&nbsp;
+
{{Languages/Lang|fr|{{{1|}}}}}
}}{{
+
{{Languages/Lang|it|{{{1|}}}}}
#ifexist: {{{1}}}/fi | <span lang="fi">[[{{{1}}}/fi|{{#language:fi}}]]</span> &nbsp;&bull;&nbsp;
+
{{Languages/Lang|he|{{{1|}}}}}
}}{{
+
{{Languages/Lang|ja|{{{1|}}}}}
#ifexist: {{{1}}}/fr | <span lang="fr">[[{{{1}}}/fr|{{#language:fr}}]]</span> &nbsp;&bull;&nbsp;
+
{{Languages/Lang|ko|{{{1|}}}}}
}}{{
+
{{Languages/Lang|no|{{{1|}}}}}
#ifexist: {{{1}}}/it | <span lang="it">[[{{{1}}}/it|{{#language:it}}]]</span> &nbsp;&bull;&nbsp;
+
{{Languages/Lang|pl|{{{1|}}}}}
}}{{
+
{{Languages/Lang|pt|{{{1|}}}}}
#ifexist: {{{1}}}/he | <span lang="he" dir="rtl">[[{{{1}}}/he|{{#language:he}}]]</span> &nbsp;&bull;&nbsp;
+
{{Languages/Lang|ru|{{{1|}}}}}
}}{{
+
{{Languages/Lang|sq|{{{1|}}}}}
#ifexist: {{{1}}}/ja | <span lang="ja">[[{{{1}}}/ja|{{#language:ja}}]]</span> &nbsp;&bull;&nbsp;
+
{{Languages/Lang|zh|{{{1|}}}}}
}}{{
 
#ifexist: {{{1}}}/ko | <span lang="ko">[[{{{1}}}/ko|{{#language:ko}}]]</span> &nbsp;&bull;&nbsp;
 
}}{{
 
#ifexist: {{{1}}}/no | <span lang="no">[[{{{1}}}/no|{{#language:no}}]]</span> &nbsp;&bull;&nbsp;
 
}}{{
 
#ifexist: {{{1}}}/pl | <span lang="pl">[[{{{1}}}/pl|{{#language:pl}}]]</span> &nbsp;&bull;&nbsp;
 
}}{{
 
#ifexist: {{{1}}}/pt | <span lang="pt">[[{{{1}}}/pt|{{#language:pt}}]]</span> &nbsp;&bull;&nbsp;
 
}}{{
 
#ifexist: {{{1}}}/ru | <span lang="ru">[[{{{1}}}/ru|{{#language:ru}}]]</span> &nbsp;&bull;&nbsp;
 
}}{{
 
#ifexist: {{{1}}}/sq | <span lang="sq">[[{{{1}}}/sq|{{#language:sq}}]]</span> &nbsp;&bull;&nbsp;
 
}}{{
 
#ifexist: {{{1}}}/zh | <span lang="zh">[[{{{1}}}/zh|{{#language:zh}}]]</span>
 
}}</span>
 
 
----
 
----
 
</div></onlyinclude>
 
</div></onlyinclude>
Line 42: Line 27:
 
  <nowiki>{{{Languages|PageName}}}</nowiki>
 
  <nowiki>{{{Languages|PageName}}}</nowiki>
  
PageName should be the name of the English version of the page.  Each non-English version is a sub-page of the English version, using the corresponding language code, and should include this template in the same way.
+
PageName should be the name of the English version of the page.  Each non-English version is a sub-page of the English version, using the corresponding language code, and should include this template in the same way.  This argument is optional, and if left out will be deduced from the current page.
  
 
For example, on the Main Page you would include the text <code><nowiki>{{{Languages|Main Page}}}</nowiki></code>, both on [[Main Page]] itself, and on each of its language sub-pages.  The template automatically creates links to any language sub-pages that exist, e.g. <tt>Main Page/ja<tt>, <tt>Main Page/fr</tt>, and ignores non-existant languages
 
For example, on the Main Page you would include the text <code><nowiki>{{{Languages|Main Page}}}</nowiki></code>, both on [[Main Page]] itself, and on each of its language sub-pages.  The template automatically creates links to any language sub-pages that exist, e.g. <tt>Main Page/ja<tt>, <tt>Main Page/fr</tt>, and ignores non-existant languages

Revision as of 00:46, 3 December 2006

Template


Geographylogo.png Reference: English – Translations:   Template:Languages/Lang Template:Languages/Lang Template:Languages/Lang Template:Languages/Lang Template:Languages/Lang Template:Languages/Lang Template:Languages/Lang Template:Languages/Lang Template:Languages/Lang Template:Languages/Lang Template:Languages/Lang Template:Languages/Lang Template:Languages/Lang Template:Languages/Lang


Usage

{{{Languages|PageName}}}

PageName should be the name of the English version of the page. Each non-English version is a sub-page of the English version, using the corresponding language code, and should include this template in the same way. This argument is optional, and if left out will be deduced from the current page.

For example, on the Main Page you would include the text {{{Languages|Main Page}}}, both on Main Page itself, and on each of its language sub-pages. The template automatically creates links to any language sub-pages that exist, e.g. Main Page/ja, Main Page/fr, and ignores non-existant languages

Supported languages

This shows you the name of each language's sub-page (using Main Page as an example). Other languages may be added easily as necessary. Please use the appropriate prefix, as used on Wikipedia when adding a new language. Please do not add languages for which no pages exist yet, as this will increase the time needed to include the template without adding any benefit (languages are only displayed to the user when the relevant page exists).

Page Name Language
Main Page English
Main Page/de German
Main Page/es Spanish
Main Page/fi Finnish
Main Page/fr French
Main Page/it Italian
Main Page/he Hebrew
Main Page/ja Japanese
Main Page/ko Korean
Main Page/no Norwegian
Main Page/pl Polish
Main Page/pt Portugese
Main Page/ru Russian
Main Page/sq Albanian
Main Page/zh Chinese

Example

Here is how the language bar looks on the MediaWiki page: