Template:Other languages/sandbox
Appearance
In other languages: [edit]
This is the template sandbox page for Template:Other languages (diff). |
This template is used in other templates with the name "Template:Other languages/Page name".
For example,
{{other languages|ar|ast|csb|da|de|diq|el|en|es|eu|fa|fr|hi|it|ja|ko|ml|ms|nl|oc|pl|pt-br|ro|ru|sv|uk|yi|zh|doctest|page=Meta:Administrators}}
renders as:
In other languages: العربية (ar) asturianu (ast) kaszëbsczi (csb) dansk (da) Deutsch (de) Zazaki (diq) Ελληνικά (el) English (en) español (es) euskara (eu) فارسی (fa) français (fr) हिन्दी (hi) italiano (it) 日本語 (ja) 한국어 (ko) മലയാളം (ml) Bahasa Melayu (ms) Nederlands (nl) occitan (oc) polski (pl) português do Brasil (pt-br) română (ro) русский (ru) svenska (sv) українська (uk) ייִדיש (yi) 中文 (zh) doctest (doctest) [edit]
Warning about the implementation:
- to avoid the nasty "template include depth limit exceeded" error (for example on Board elections/2008), do not factorize the list of #if making this template. Keep it linear, otherwise it will break important pages on this wiki using this template for accessing available translations. The way it is made does not exhaust the server resources (it also allows this template to support up to 80 languages, possibly more if the template is extended to support more parameters), but factorizing #if will exhaust them (in terms of total parameter size for their expansion) and will definitely not optimize things.
- this template still uses the costly parser function
#ifexist
for each language code in parameter, in order to generate customized creation links (using the specified base page name to preload it) instead of standard red links for inexistant pages. It cannot be used on pages where this template would be implicitly called by transcluding many other pages or templates referencing it. For a version of this template that does not use preloads but generate standard red wikilinks, use the variant Template:Other languages/not tested:
{{other languages/not tested|ar|ast|csb|da|de|diq|el|en|es|eu|fa|fr|hi|it|ja|ko|ml|ms|nl|oc|pl|pt-br|ro|ru|sv|uk|yi|zh|doctest|page=Meta:Administrators}}
renders as:
In other languages: العربية (ar) asturianu (ast) kaszëbsczi (csb) dansk (da) Deutsch (de) Zazaki (diq) Ελληνικά (el) English (en) español (es) euskara (eu) فارسی (fa) français (fr) हिन्दी (hi) italiano (it) 日本語 (ja) 한국어 (ko) മലയാളം (ml) Bahasa Melayu (ms) Nederlands (nl) occitan (oc) polski (pl) português do Brasil (pt-br) română (ro) русский (ru) svenska (sv) українська (uk) ייִדיש (yi) 中文 (zh) doctest (doctest) [edit]
See how the non-existing language code "doctest" is no longer rendered in red but brings to a page that will not create the subpage by default.