Difference between revisions of "Template:Local"

From PC-BSD Wiki
Jump to: navigation, search
(Since it doesn't play nice with {{pageNUM}} need to add txt=)
 
(43 intermediate revisions by one user not shown)
Line 1: Line 1:
<includeonly>[[{{#if: {{{1}}}|{{hasAnchor}}{{!}}{{{1}}}|{{hasAnchor}}{{#if: {{getLang}}|{{!}}{{:Translations:{{#titleparts: {{{link}}}|1|1}}/Page display title/{{getLang}}}}|}}}}]]</includeonly><noinclude>
+
<includeonly><onlyinclude><span class="usesLocal">{{#if: {{{link|}}}|[[{{{link}}}{{putVers}}{{putLang}}{{hasAnchor|{{{anchor|}}}}}|{{{txt|{{{1|{{#if: {{getLang}}|{{:Translations:{{#titleparts: {{{link}}}|1|1}}{{putVers}}/Page display title{{putLang}}}}|{{{link|Missing link}}}}}}}}}}}]]|}}{{#if: {{{static|}}}|[[{{{static}}}{{putLang}}{{hasAnchor|{{{anchor|}}}}}|{{{txt|{{{1|{{#if: {{getLang}}|{{:Translations:{{#titleparts: {{{static}}}|1|1}}/Page display title{{putLang}}}}|{{{static|Missing static}}}}}}}}}}}]]|}}{{#if: {{{bare|}}}|[[{{{bare}}}{{hasAnchor|{{{anchor|}}}}}|{{#if: {{{anchor|}}}|{{{anchor}}}|{{{txt|{{{1|{{{bare}}}}}}}}}}}]]}}</span></onlyinclude></includeonly><noinclude>
 +
<!-- do not try to use template:pagenameOnly because it will not work for some reason -->
 +
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.
  
 
+
* The page will be automagically related to version and translation as well as have its visible text translated as appropriate:
Work in progress: 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:''' '''<nowiki>{{local|</nowiki>link='''''page URL'''''|'''''alternate text'''''}}'''
 
: '''Usage:''' '''<nowiki>{{local|</nowiki>link='''''page URL'''''|'''''alternate text'''''}}'''
 
+
* The page does not have a version associated with it but might be translated:
: '''Example:''' <nowiki>[[Goals and Features|Project Goals and Spiffy Bits]]</nowiki> '''becomes''' <nowiki>{{local|link=Goals and Features|Project Goals and Spiffy Bits}}</nowiki>
+
: '''Usage:''' '''<nowiki>{{local|</nowiki>static='''''page URL'''''|'''''alternate text'''''}}'''
 +
* The URL must contain version or language as needed because the page is somehow a special case and will not automagically receive either:
 +
: '''Usage:''' '''<nowiki>{{local|</nowiki>bare='''''page URL'''''|'''''alternate text'''''}}'''
 +
Examples:
 +
: {{ltag|Goals and Features{{!}}Project Goals and Spiffy Bits}} '''becomes''' {{ttag|local{{!}}link{{=}}Goals and Features{{!}}Project Goals and Spiffy Bits}}
 +
: {{ltag|Disk_Selection_Screen#Advanced_Mode{{!}}Advanced Mode}} '''becomes''' {{ttag|local{{!}}link{{=}}Disk_Selection_Screen{{!}}anchor{{=}}Advanced_Mode{{!}}Advanced Mode}}
 
[[category:templates]]</noinclude>[[category:Uses local]]
 
[[category:templates]]</noinclude>[[category:Uses local]]

Latest revision as of 22:15, 2 March 2015

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.

  • The page will be automagically related to version and translation as well as have its visible text translated as appropriate:
Usage: {{local|link=page URL|alternate text}}
  • The page does not have a version associated with it but might be translated:
Usage: {{local|static=page URL|alternate text}}
  • The URL must contain version or language as needed because the page is somehow a special case and will not automagically receive either:
Usage: {{local|bare=page URL|alternate text}}

Examples:

[[Goals and Features|Project Goals and Spiffy Bits]] becomes {{local|link=Goals and Features|Project Goals and Spiffy Bits}}
[[Disk_Selection_Screen#Advanced_Mode|Advanced Mode]] becomes {{local|link=Disk_Selection_Screen|anchor=Advanced_Mode|Advanced Mode}}
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox