Template:Multilingual link

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Multilingual link/doc.

This template allows to create links to different language versions of same Wikipedia article, and only one link will be displayed.

Usage[edit]

Main parameters[edit]

Just use ISO codes of languages as parameter names, and article names as parameter values.

For example, you can write
{{multilingual link
|ar=حركة الإنترنت
|el=Διαδικτυακή κυκλοφορία
|en=Internet traffic
|eo=Reta trafiko
|fr=Trafic Internet
|gl=Tráfico en Internet
|ko=인터넷 트래픽
|pl=Ruch internetowy
|ru=Сетевой трафик
|sl=Internetni promet (statistika)
|uk=Інтернет трафік
|uz=Tarmoq trafigi
|vi=Lưu lượng truy cập
}}

and the template will display just one link. Users with interface in one of the mentioned languages (Arabic, English, Esperanto, French, Galician, Greek, Korean, Polish, Russian, Slovenian, Ukrainian, Uzbek, Vietnamese) will see the link to the article in their language; users with interface in some other language will see the English link.

Default language[edit]

When default language is not indicated, default language is English (en) if it is present.

The code
{{multilingual link
|eo=David Mentelli
|hu=Mandelli Dávid
|ru=Ментелли, Давид
}}

will create a link for users with interface in Esperanto, Hungarian or Russian, but other users will see nothing because no default language is indicated.

But you can write
{{multilingual link
|eo=David Mentelli
|hu=Mandelli Dávid
|ru=Ментелли, Давид
|default=eo
}}

and other users (with interface not in Esperanto, Hungarian or Russian) will see the link in Esperanto. The value of the parameter default must be just ISO code, and version in the indicated language must be provided. If you use the parameter default but do not provide the name of article in the language of some user neither in the indicated default language (for example, you write |default=fr but do not fill the parameter fr), the template will display nothing for that user.

If you do not use the parameter default, be sure to have an English version (the parameter en). If the article has not an English version, be sure to use the parameter default. And if you use the parameter default, be sure to have also the parameter for the indicated default language (for example, if you write |default=de, the parameter de must be present).

If both parameters en and default are present, the parameter default takes precedence. For example, if you write
{{multilingual link
|en=MHSnet
|eo=.oz
|fr=.oz
|ru=.oz
|uk=.oz
}}

than users with interface in English, Esperanto, French, Russian or Ukrainian will see the link in their interface language, and all other users will see the link in English. But if you write
{{multilingual link
|en=MHSnet
|eo=.oz
|fr=.oz
|ru=.oz
|uk=.oz
|default=eo
}}

than users with interface in English, Esperanto, French, Russian or Ukrainian will see the link in their interface language, and all other users will see the link in Esperanto.

Displayed titles[edit]

By default, visible text of link is article name. It can be changed with parameters, whose names consist of the word title, space and ISO code of language. For example, if you write
{{multilingual link
|de=Scharfrichterhaus (Passau)
|en=Scharfrichterhaus
|zh=刽子手之家
}}

than all users will see just article names, but if you write
{{multilingual link
|de=Scharfrichterhaus (Passau)|title de=Scharfrichterhaus
|en=Scharfrichterhaus
|zh=刽子手之家
}}

than users with German language interface will see the title Scharfrichterhaus pointing to the article Scharfrichterhaus (Passau). Titles can be provided for many languages; for example, you can write
{{multilingual link
|de=The Octagon (Dunedin)|title de=The Octagon
|en=The Octagon, Dunedin|title en=The Octagon
|zh=八角广场 (但尼丁)|title zh=八角广场
}}

Also, you can provide one universal title for all languages; for example:
{{multilingual link
|en=NEC μCOM series
|it=Serie NEC μCOM
|ja=ΜCOMシリーズ
|title=NEC µPD780C
}}

Syntax helper[edit]

The wikitext to call the template {{multilingual link}} can be long (sometimes hundreds of lines), writing such text is a tedious task. The Perl script Syntax helper creates such wikitext for you. For example, if you type ./syntaxhelper.perl en:Saint Petersburg State Agrarian University or ./syntaxhelper.perl Q1628690, it returns the wikitext
{{multilingual link
|be=Санкт-Пецярбургскі дзяржаўны аграрны ўніверсітэт
|en=Saint Petersburg State Agrarian University
|eo=Sankt-Peterburga Ŝtata Agrikultura Universitato
|et=Peterburi Riiklik Agraarülikool
|fr=Université agraire d'État de Saint-Pétersbourg
|ru=Санкт-Петербургский государственный аграрный университет
}}

and you just need to copy and past that wikitext. See the Syntax helper.