Template:LanguageSelector
模板頁面
更多操作
This documentation is transcluded from Template:LanguageSelector/doc.
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. ;)
用法
{{LanguageSelector |icons= |<unnamed parameters, numbered 2..40>= |notpiol= |action= }}
- 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.
模板參數
| 參數 | 描述 | 預設 | 狀態 | |
|---|---|---|---|---|
icons | determines what is displayed
| yes | 非必填 | |
<unnamed parameters, numbered 2..40> | A language code. If present, a link for the corresponding language will be produced. Up to 19 language codes 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 | 非必填 | |
notpiol | dummy parameter, if assigned any value, it will suppress the 'This page in other languages: ' text | optional | 非必填 | |
action | passed through to {{UselangLink}}, read documentation there for further information | optional | 非必填 | |
其他資訊
該模板可以用於以下名字空間: 所有名字空間
該模板可以由以下群組使用: 所有用戶
用到的模板:
- {{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
- {{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
參見
Related templates
- {{Language versions}}
- {{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
icons=no - {{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
- meta:List of Wikipedias at Meta
- incubator:Main_Page list of proposed projects at Incubator
Examples
| Code | Rendering on page |
|---|---|
{{LanguageSelector|de|en|fr|invalid}} | |
{{LanguageSelector|de|en|fr|invalid|action=edit}} | |
{{LanguageSelector|de|en|fr|invalid|icons=code}} | |
{{LanguageSelector|de|en|fr|notpiol=1}} | |
{{LanguageSelector|de|en|fr|notpiol=1|icons=yes}} | |
{{LanguageSelector|de|en|fr|notpiol=1|icons=code}} | |
{{LanguageSelector|de|en|fr|notpiol=1|icons=only}} |
There are more examples with the default full list of languages on Template:LanguageSelector/doc/examples.
- (Dont put examples with all languages here at it would break the transclusion of the documentation subpage in the main template page).