Difference between revisions of "Template:Local"

From PC-BSD Wiki
Jump to: navigation, search
(thinking :))
Line 4: Line 4:
  
 
{{#if: {{{1}}}
 
{{#if: {{{1}}}
   |{{#if: {{{anchor}}}
+
   |{{#if: {{{anchor}}} <!-- has alt text -->
       |[[{{{link|}}}{{putLang}}{{pound}}{{{anchor}}}{{!}}{{{1{{!}}{{#if: {{getLang}}
+
       |[[{{{link|}}}{{putLang}}{{pound}}{{{anchor}}}|{{#if: {{getLang}} <!-- has anchor -->
                                                                  |{{:Translations:{{#titleparts: {{{link}}}|1|1}}/Page display title/{{getLang}} }}{{!}}{{{link|Missing link}}} }} }}}]]
+
                                                            |{{:Translations:{{#titleparts: {{{link}}}|1|1}}/Page display title/{{getLang}} }}]] <!-- on lang page -->
                                                                  |{{#if: {{{anchor}}}
+
                                                            |   <!-- not on lang page -->
                                                                      |[[{{{link}}}{{putLang}}{{pound}}{{{anchor}}}]]
+
                                                          }}
                                                                      |[[{{{link}}}{{putLang}}
+
      | <!-- has no anchor -->
                                                                  }}]]
+
 
                                                              }}
+
   |[[{{{link}}}{{putLang}}]] <!-- no alt text -->
    }}
+
   |[[{{{link}}}{{putLang}}]]
+
 
}}
 
}}
  

Revision as of 21:49, 3 September 2013



{{#if: {{{1}}}

  |{{#if: {{{anchor}}}  
      |[[#{{{anchor}}}|
      | 
  |[[{{{link}}}]] 

}}


{{{1}}} is the alternate text.

[[|Missing link ]]

This template hopes to solve the trouble of localization of links within the wiki. The link will automatically match the localized page URL (such as Goals and features/en) of the page that the link resides. As with other locations on the wiki, if the page for the local link has not yet been translated, it will not then exist and will appear as a red link.

Usage: {{local|link=page URL|alternate text}}
Example: [[Goals and Features|Project Goals and Spiffy Bits]] becomes {{local|link=Goals and Features|Project Goals and Spiffy Bits}}