User:Wynndale/LanguageLink
Jump to navigation
Jump to search
[[:{{{2}}}:{{{3}}}|· {{{2}}}]]
This documentation is transcluded from User:Wynndale/LanguageLink/doc. (Edit | history)
Note to editors: Please don't categorize this template by editing it directly. Instead, place the category in its documentation page, in its "includeonly" section.
Note to editors: Please don't categorize this template by editing it directly. Instead, place the category in its documentation page, in its "includeonly" section.
Usage
- Basically, this template is used as part of Template:Languages.
Parameters:
- 1st: (mandatory) a leading namespace prefix for the target page – for example, Help: or TemplateLeave empty for the main namespace.
- 2nd: (mandatory) the language code, always lowercase – for example, de, en, or zh-hans
- 3rd: (mandatory) the target base page name of the displayed link – for example, JOSM
- 4th: (optional) the language name to display – use it if Mediawiki cannot generate the language name itself by
{{#language:code}}
Example:
{{User:Wynndale/LanguageLink|Template:|ru|LanguageLinks}} {{User:Wynndale/LanguageLink||de|JOSM}} {{User:Wynndale/LanguageLink||ja|JOSM}} {{User:Wynndale/LanguageLink||ja|JOSM|Nihongo}}
- generates:
- · русский · Deutsch · 日本語 · Nihongo
Notes
Language prefixes are also needed for other namespaces:
- Templates in specific languages, notably when they are not simply "autotranslated".
- Categories and templates only for the 7 languages have also been created with a language prefix in block capitals.
- Pages in the local project namespace "OpenStreetMap:" (but not "MediaWiki:", "Help:", "Gadget:", and "Gadget definition:" using subpages).
Caveats
- Prefixes are still also used on a few user pages (and their talk pages), though they should better not use prefixes but should suffix subpages (we could tweak the navigation bar for "User:" and "User talk:" to use subpages instead, or create another languages bar for them, and then move those pages to the correct user space).
- There's no naming rule for the "File:" namespace (borrowed from Wikimedia Commons): no common prefix, and no subpages at all (and those pages are not movable). The languages navigation bar is not usable at all in that namespace. Navigation should be made directly in the description page on Commons using the "other versions" links in description boxes.