Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079

Warning: Illegal offset type in unset in /home/acanthus/nevacal.com/w/LocalSettings.php on line 1079
 Template:Lang links subst - NevaCal

Template:Lang links subst

From NevaCal

Jump to: navigation, search
Notice Please note that this template must be substituted. Replace {{lang links subst}} with {{subst:lang links subst}}.
Note: This template's code is hidden from view.

}}{{subst:#ifexist:{{subst:NAMESPACE}}:{{subst:BASEPAGENAME}}/de| [[{{subst:NAMESPACE}}:{{subst:BASEPAGENAME}}/de{{subst:!}}Deutsch]] {{subst:!}} }}{{subst:#ifexist:{{subst:NAMESPACE}}:{{subst:BASEPAGENAME}}/en| [[{{subst:NAMESPACE}}:{{subst:BASEPAGENAME}}/en{{subst:!}}English]] {{subst:!}}| [[{{subst:NAMESPACE}}:{{subst:BASEPAGENAME}}|English]] {{subst:!}}}} }}{{subst:#ifexist:{{subst:NAMESPACE}}:{{subst:BASEPAGENAME}}/es| [[{{subst:NAMESPACE}}:{{subst:BASEPAGENAME}}/es{{subst:!}}Español]] {{subst:!}} }}{{subst:#ifexist:{{subst:NAMESPACE}}:{{subst:BASEPAGENAME}}/fr| [[{{subst:NAMESPACE}}:{{subst:BASEPAGENAME}}/fr{{subst:!}}Français]] {{subst:!}} }}[{{fullurl:{{subst:NAMESPACE}}:{{subst:BASEPAGENAME}}/lang|action=edit}} +/−]

Usage

This template is the substitution version of {{Lang links}}. It's meant to be subst'd on /lang pages. It can be used to add all available translation links and format them correctly all in one step. Simply replace the whole page (except the <noinclude> parts) with {{subst:lang links subst}}.

This only works for pages whose translation subpages follow the standard naming convention of "../language_code".

Technical information

The empty comments are necessary for making new lines inside the {{nl}}; they also supply the spaces after the links (in MediaWiki, a single carriage return will not create a line break). This method is used instead of another &nbsp; or &#32; (non-breaking space and regular space) to make the source easier to read when viewed directly.

Substitution leaves no templates, "magic word" variables, or parser functions behind except a {{#language:}} for each link and one {{Edit}} (for the +/- edit link). This is to reduce server stain and not count much towards any pre-processor/post-expand limits, specifically the expensive parser function count—the whole reason for using this instead of the maintenance-free {{Lang links}}. The unsubst'd version contains 101 #ifexist functions out of the maximum of 500 allowed. This number of #ifexists will continue to grow as new languages are added; they are usually added as soon as one translation in that language appears on Commons. The limit may also decrease in the future (there was talk of reducing it to 100).

It's very important for "/lang" pages to be as light as possible on the servers because they are generally transcluded in a template, or group of templates, which are then transcluded wherever that template is used. Many, such as license templates, are used on a lot of pages. It doesn't matter if the template itself is subst'd (like with user messages) because the {{.../lang}} inside of it isn't. Recursive substitution should never be used either because it will make a huge mess. All kinds of templates and pages have language links so it's never known if those extra ∼100 may be needed. If, let's say, 5 user message templates that all use {{Lang links}} are placed on a talk page (subst'd or not), that page will be above the limit. Using this template avoids all of that.

Personal tools