Difference between revisions of "Template:Localized/doc"

From translatewiki.net
Jump to navigation Jump to search
m
 
 
(2 intermediate revisions by 2 users not shown)
Line 18: Line 18:
 
* <tt>1=</tt> (mandatory) base template name (without any namespace prefix and without any language code subpage)
 
* <tt>1=</tt> (mandatory) base template name (without any namespace prefix and without any language code subpage)
 
* <tt>ns=</tt> (optional) alternate namespace to test (default namespace is <tt>Template</tt>)
 
* <tt>ns=</tt> (optional) alternate namespace to test (default namespace is <tt>Template</tt>)
* <tt>lang=</tt> language code to test (the default code used is the language code taken from a localized subpage where this template is inserted, otherwise the default is <nowiki>{{UILANGCOE}}</nowiki> on non localized pages)
+
* <tt>lang=</tt> language code to test (the default code used is the language code taken from a localized subpage where this template is inserted, otherwise the default is <nowiki>{{UILANGCODE}}</nowiki> on non localized pages)
  
 
; Example<nowiki>:</nowiki>
 
; Example<nowiki>:</nowiki>
Line 30: Line 30:
  
 
; See also<nowiki>:</nowiki>
 
; See also<nowiki>:</nowiki>
* [[Template:Doc]]
+
* [[Template:LocalizedLink]]
 +
* [[meta:Template:Translatable template]], [[meta:Template:Translatable template name]]
  
 
<includeonly><!-- Categories for the parent template page -->
 
<includeonly><!-- Categories for the parent template page -->

Latest revision as of 06:03, 17 October 2014

Test Template Info-Icon - Version (2).svg
This is the documentation subpage for the parent Template:Localized page.

Retrieves the name of a localized template, using the base template name given in parameter 1. Such localizable base template has subpages named with the language code.

The returned value is the full page name that can be used for transclusion.

If no localized page exists for that template in the tested language, then the full name of the base template will be returned (if it exists too).

If the base template does not even exist, the full page name of Template:Localized/Missing will be returned to signal the invalid or missing parameter 1 that should be a valid template name without the namespace prefix (that must be passed separately if this is not "Template").

Usage:
  • {{Localized
| 1=base template name
| ns=namespace
| lang=uilangcode
}}
Parameters:
  • 1= (mandatory) base template name (without any namespace prefix and without any language code subpage)
  • ns= (optional) alternate namespace to test (default namespace is Template)
  • lang= language code to test (the default code used is the language code taken from a localized subpage where this template is inserted, otherwise the default is {{UILANGCODE}} on non localized pages)
Example:
  • {{Localized
| 1=Intro
}} generates:

Template:Intro/en

See also: