Template:LanguageSelector
From WikiEducator
[edit]
Documentation
(this part of the documentation is only available in some languages)
Displays a configurable set of links that switch the page it's used on to another language. It is intended to complement {{LangSwitch}}, but you might find previously unintended uses. ;)
Contents
Usage
{{LanguageSelector|icons=|<unnamed parameter>=|notpiol=|action=}}
(this part of the documentation is only available in some languages)
A few examples:
{{LanguageSelector}} | |
{{LanguageSelector|icons=no}} | |
{{LanguageSelector|icons=only}} | |
{{LanguageSelector|icons=code}} | |
{{LanguageSelector|zh|de}} | |
{{LanguageSelector|zh|de|w33}} | |
{{LanguageSelector|zh|de|w33|icons=code}} | |
{{LanguageSelector|zh|de|en}} | |
{{LanguageSelector|invalid}} | |
{{LanguageSelector|notpiol=1|es|fr|zh}} | |
{{LanguageSelector|notpiol=1|icons=only}} | |
{{LanguageSelector|zh|de|action=action=edit}} |
- The switch only applies to the page the template is transcluded on, clicking other links will return you to the language set in your MediaWiki preferences. This does not generally apply to script calls, e. g. "hide/show" links, or controls for sortable tables or other embedded stuff.
- The template can be used inline, it should not break any layout.
Parameters
Parameter name | Description (this part of the documentation is only available in some languages) | Default value | required or optional?
|
---|---|---|---|
icons | determines what is displayed
|
yes | optional |
<unnamed parameter> | If present, a link for the corresponding language will be produced. Up to nine languages can currently be specified, and will display in the order indicated by the parameter sequence. If no unnamed parameters are specified, all languages will be displayed in the default order. | optional | optional |
notpiol | dummy parameter, if assigned any value, it will suppress the 'This page in other languages: ' text | optional | optional |
action | passed through to {{UselangLink}}, read documentation there for further information | optional | optional |
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
Relies on:
- {{LanguageSelector/full}} produces a default set when no languages are specified
- {{LanguageSelector/switch}} maps language codes to icons
- {{LanguageSelector/link}} produces a link to a single language, optionally with icon
- {{UselangLink}}
- {{LanguageSelector/ThisPageIn}} returns "This page in other languages", supports LangSwitch
- {{LanguageSelector/InterLanguageSpacer}} used to separate the language links from each other
- {{LanguageSelector/iconfile}} returns filename of default icon for given language code
- {{LanguageSelector/IfPageExists}} cheap replacement for #ifexist: parser extension function
See also
(this part of the documentation is only available in some languages)
Related templates
- {{autotranslate}} "used to show a template in the user's interface language"
- {{LangSwitch}} marks up translations of a given string, from which an appropriate language to display is selected based upon user preferences, resorting to default fallback languages when the requested one is not available
- {{LanguageSelectorFlags}} alias for {{LanguageSelector}}
- {{LanguageSelectorNoFlags}} wrapper that changes default behavior to Template:Codef
- {{Fallback}} determines fallback language when the desired one isn't available, uses {{GetFallback}} and {{GetFallback2}} (secondary fallback language)
Language resources
If you want to add languages, the following resources might be useful
- User:Paradoctor/WikipediaLanguages list of all Wikipedia languages as of 12 January 2010
- Category:Flags of languages
- w:ISO-639 two- and three-letter language codes
- List of languages by English name
- List of languages in in their own writing systems, you can also plunder any article with lots of interwiki links, like w:sex
- m:List of Wikipedias at Meta
- incubator:Main_Page list of proposed projects at Incubator