Difference between revisions of "Template:Languages"

From VideoLAN Wiki
Jump to navigation Jump to search
m (Bug fix)
(I improved this template, it now uses a parser function to calculate the page names automatically. All my work, so no attribution is necessary for copyright)
Line 3: Line 3:
 
<tr style="background: #ebf0fa; vertical-align: top;">
 
<tr style="background: #ebf0fa; vertical-align: top;">
 
<td style="width: 10px; white-space: nowrap; padding: 4px 1em 0 0.5em; border-right: 1px solid #888;">'''Languages:'''&nbsp;</td><td style="padding: 1px 1em 0; background: #F6F9ED;">
 
<td style="width: 10px; white-space: nowrap; padding: 4px 1em 0 0.5em; border-right: 1px solid #888;">'''Languages:'''&nbsp;</td><td style="padding: 1px 1em 0; background: #F6F9ED;">
'''[[{{{1|:{{NAMESPACE}}:{{BASEPAGENAME}}}}}|English]]'''<!--
+
'''[[{{#titleparts:{{FULLPAGENAME}}|1}}{{!}}English]]'''<!--
-->{{Languages/Lang|de|{{{1|}}}}}<!--
+
-->{{Languages/Lang|de}}<!--
-->{{Languages/Lang|fr|{{{1|}}}}}<!--
+
-->{{Languages/Lang|fr}}<!--
-->{{Languages/Lang|nl|{{{1|}}}}}<!--
+
-->{{Languages/Lang|nl}}<!--
-->{{Languages/Lang|sk|{{{1|}}}}}<!--
+
-->{{Languages/Lang|sk}}<!--
 
--></td></tr></table></div></onlyinclude><noinclude>
 
--></td></tr></table></div></onlyinclude><noinclude>
 
==Syntax==
 
==Syntax==
<nowiki>{{Languages|PageName}}</nowiki>
+
<nowiki>{{Languages}}</nowiki>
  
PageName (optional) - name of the page on which we would like to show the language links.
+
* On both [[Common Problems]] and [[Common Problems/fr]] we use simply <nowiki>{{Languages}}</nowiki> and the pages will be linked.
* Leave blank on the main page. For example, on [[Common Problems]] we use simply <nowiki>{{Languages}}</nowiki>.
 
* Put the name of the page itself on language sub-pages. For example, on [[Common Problems/fr]] we must use <nowiki>{{Languages|Common Problems}}</nowiki>.
 
  
 
==Usage==
 
==Usage==

Revision as of 04:25, 8 February 2019

Syntax

{{Languages}}

Usage

  • Place only pages that exist in more than one language
  • Place in the same location on each translation of the page
  • The English version of a page is always the main version
  • Using the appropriate language code in the format "pagenamehere/language_code"

For example, see above.