Template:LocalizedLink: Difference between revisions From Online Manual

Jump to: navigation, search
(Created page with "<includeonly>[[<!-- -->{{#if:<!-- -->{{#if:{{{lang|}}}|<!-- -->{{#ifexist:{{#if:{{{ns|}}}|{{{ns|}}}:}}:{{{1}}}/{{{lang|}}}|<!-- -->1<!-- -->}}<!-- -->}...")
 
(code from wikimedia http://strategy.wikimedia.org/wiki/Template:Localized_link)
Line 1: Line 1:
<includeonly>[[<!--
<!--
-->{{#if:<!--
-->[[{{{1}}}<!--                                               target page name (required)
  -->{{#if:{{{lang|}}}|<!--
  -->{{#ifexist:{{{1}}}/{{SUBPAGENAME}}|/{{SUBPAGENAME}}}}<!-- current subpage (if it exists)
      -->{{#ifexist:{{#if:{{{ns|}}}|{{{ns|}}}:}}:{{{1}}}/{{{lang|}}}|<!--
  -->#{{{anchor|}}}<!--                                       optional anchor (if specified)
        -->1<!--
-->|{{#if:{{{2|}}}|{{{2|}}}|{{{1}}}}}<!--                     visible translation or pagename
      -->}}<!--
-->]]<!--
  -->}}<!--
-->{{#ifexist:{{{1}}}/{{SUBPAGENAME}}||<!--     if subpage does not exist
-->|{{#if:{{{ns|}}}|{{{ns|}}}:}}{{{1}}}/{{{lang|}}}<!--
  -->{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}||<!-- and it is on a subpage
-->|<!--
    -->&nbsp;<small dir="ltr">(en)</small>}}<!-- then add "(en)"
  THE LANGUAGE CODE OF THE CURRENT PAGE SHOULD ALWAYS BE TESTED FIRST!
-->}}<noinclude>[[Category:Localisation templates|{{PAGENAME}}]]</noinclude>
  -->{{#if:<!--
      -->{{#ifeq:{{BASEPAGENAME}}/{{SUBPAGENAME}}|{{PAGENAME}}|<!--
        -->{{#ifexist:{{#if:{{{ns|}}}|{{{ns|}}}:}}{{{1}}}/{{SUBPAGENAME}}|<!--
            -->1<!--
        -->}}<!--
      -->}}<!--
      Use the existing subpage with the same language code:
  -->|{{#if:{{{ns|}}}|{{{ns|}}}:}}{{{1}}}/{{SUBPAGENAME}}<!--
  -->|<!--
      NOTE THAT THE {{UILANGCODE}} HAS CAVEATS WITH MEDIAWIKI CACHE. IT SHOULD BE TESTED ONLY AFTER THE PREVIOUS ONE!
      -->{{#ifexist:{{#if:{{{ns|}}}|{{{ns|}}}:}}{{{1}}}/{{UILANGCODE}}<!--
          Use the existing subpage with the default {{UILANGCODE}}
      -->|{{#if:{{{ns|}}}|{{{ns|}}}:}}{{{1}}}/{{UILANGCODE}}<!--
      -->|<!--
        DEFAULT IS THE UNTRANSLATED PAGE
        -->{{#if:{{{ns|}}}|{{{ns|}}}:}}{{{1}}}<!--
      -->}}<!--
  -->}}<!--
-->}}|{{#if:{{{2|}}}|{{{2|}}}|{{{1}}}}}]]</includeonly><noinclude>{{doc}}</noinclude>

Revision as of 16:06, 2 August 2011

[[{{{1}}}#|{{{1}}}]]



Advertisement: