Template:Ls/doc

From translatewiki.net
This is the documentation subpage for the parent Template:Ls page.
Usage:
This template wraps translations for Language select, a script which dynamically hides languages when the user's preferred language is available.
Syntax:
  • {{Ls|
    1 = language code |
    2 = text |
    tag = [HTML element type] |
    label = [flag] |
    update = [language code] |
    CSS-box = [CSS styles] |
    CSS-label = [CSS styles] }}
Parameters:
  • 1= the valid BCP 47 language code (required); if the language code is missing, invalid or not supported, the language label will show instead the provided label (or "und" for an undetermined language) with a red color.
  • 2= the source text or translation for that language (required).
  • tag= set it to "span" to render the box as an "inline" span HTML element (optional, empty by default to render the box into a "div" block HTML element). Valid "block" tags for HTML are one of: div, h1, h2, h3, h4, h5, h6, p, blockquote, ol, ul, li, dl, dt, dd, tr, th, or td; valid "mixed-content" tags for HTML are one of: bdo, or bdi; valid "inline" tags for HTML are one of: span, b, strong, i, em, var, u, ins, s, del, big, small, sub, sup, samp, abbr, q, code, kbd, or tt.
  • label= set it to "no" to avoid rendering the header showing the language name and colon (optional, empty by default).
  • update= a valid BCP 47 language code of the source language code when its label was updated and the translated text needs to be updated (optional, empty by default).
  • CSS-box = custom CSS for the container box (optional, empty by default).
  • CSS-label = custom CSS for the leading language label (optional, empty by default).
Examples:
<div class="multilingual">
{{ls|af|Hierdie teks is in Afrikaans.}}
{{ls|id|Ini adalah teks dalam bahasa Indonesia.}}
{{ls|ms|Teks ini ditulis dalam Bahasa Melayu.}}
{{ls|bar|Des is a boarischa Text.}}
{{ls|br|Brezhoneg eo an destenn-mañ.}}
{{ls|ca|Aquest text és en català.}}
{{ls|da|Denne tekst er på dansk.}}
{{ls|de|Dieser Text ist Deutsch.}}
{{ls|en|This text is English.}}
{{ls|es|Ese texto está en español.}}
{{ls|eo|Ĉi tiu teksto estas en Esperanto.}}
{{ls|et|See tekst on eesti keeles.}}
{{ls|fr|Ce texte est en français.}}
{{ls|fy|Dizze tekst is yn it Frysk.}}
{{ls|gl|Este texto está en galego.}}
{{ls|hr|Ovaj tekst je na hrvatskom jeziku.}}
{{ls|ia|Iste texto es in interlingua.}}
{{ls|it|Questo testo è in Italiano.}}
{{ls|ku|Ev xet bı Kurdi'yı.}}
{{ls|kurmanci|Ev xet bı Kurmanci'ye.}}
{{ls|la|Haec nota latine scriptus est.}}
{{ls|lt|Šis tekstas yra lietuviškas}}
{{ls|hu|Ez a szöveg magyarul van}}
{{ls|nl|Deze tekst is in het Nederlands.}}
{{ls|no|Denne teksten er på norsk.}}
{{ls|oc|Aqueste tèxt es en occitan.}}
{{ls|pl|Ten tekst jest po polsku.}}
{{ls|pt|Este texto está em português.}}
{{ls|sc|Custu testu est in sardu.}}
{{ls|fi|Tämä teksti on suomeksi.}}
{{ls|sv|Denna text är på svenska.}}
{{ls|tr|Bu tekst Türkçe'dir.}}
{{ls|el|Αυτό το κείμενο είναι στα Ελληνικά.}}
{{ls|be|Гэты тэкст — на беларускай мове.}}
{{ls|be-tarask|Гэты тэкст — на беларускай мове.}}
{{ls|bg|Този текст е на български език.}}
{{ls|mk|Ова е текст на македонски јазик.}}
{{ls|ru|Этот текст — на русском языке.}}
{{ls|hy|Այս տեքստը անգլերեն է:}}
{{ls|ka|ეს ტექსტი ქართულ ენაზეა.}}
{{ls|hi|यह पाठ अंग्रेजी है।}}
{{ls|or|ଏହି ଲେଖାଟି ଓଡ଼ିଆ ଭାଷାରେ ଲେଖାଯାଇଛି।}}
{{ls|ta|இது தமிழ் மொழி.}}
{{ls|km|ឃ្លានេះជាភាសាខ្មែរ។}}
{{ls|ko|이 글은 한국어입니다.}}
{{ls|ja|この文章は日本語です。}}
{{ls|zh-hans|这些文字是中文。}}
{{ls|zh-hant|這些文字是中文。}}
{{ls|he|הטקסט הזה בעברית.}}
{{ls|ar|هذا النّص عربي.}}
{{ls|fa|این متن فارسی است.}}
{{ls|ug|بۇلار ئۇيغۇرچە.}}
</div>
Afrikaans: Hierdie teks is in Afrikaans.
Bahasa Indonesia: Ini adalah teks dalam bahasa Indonesia.
Bahasa Melayu: Teks ini ditulis dalam Bahasa Melayu.
Boarisch: Des is a boarischa Text.
Brezhoneg : Brezhoneg eo an destenn-mañ.
Català : Aquest text és en català.
Dansk: Denne tekst er på dansk.
Deutsch: Dieser Text ist Deutsch.
English: This text is English.
Español : Ese texto está en español.
Esperanto: Ĉi tiu teksto estas en Esperanto.
Eesti: See tekst on eesti keeles.
Français : Ce texte est en français.
Frysk: Dizze tekst is yn it Frysk.
Galego: Este texto está en galego.
Hrvatski: Ovaj tekst je na hrvatskom jeziku.
Interlingua: Iste texto es in interlingua.
Italiano: Questo testo è in Italiano.
Kurdî: Ev xet bı Kurdi'yı.
Kurmanci: Ev xet bı Kurmanci'ye.
Latina: Haec nota latine scriptus est.
Lietuvių: Šis tekstas yra lietuviškas
Magyar: Ez a szöveg magyarul van
Nederlands: Deze tekst is in het Nederlands.
Norsk: Denne teksten er på norsk.
Occitan : Aqueste tèxt es en occitan.
Polski: Ten tekst jest po polsku.
Português : Este texto está em português.
Sardu: Custu testu est in sardu.
Suomi: Tämä teksti on suomeksi.
Svenska: Denna text är på svenska.
Türkçe: Bu tekst Türkçe'dir.
Ελληνικά: Αυτό το κείμενο είναι στα Ελληνικά.
Беларуская: Гэты тэкст — на беларускай мове.
Беларуская (тарашкевіца): Гэты тэкст — на беларускай мове.
Български: Този текст е на български език.
Македонски: Ова е текст на македонски јазик.
Русский: Этот текст — на русском языке.
Հայերեն. Այս տեքստը անգլերեն է:
ქართული: ეს ტექსტი ქართულ ენაზეა.
हिन्दी: यह पाठ अंग्रेजी है।
ଓଡ଼ିଆ: ଏହି ଲେଖାଟି ଓଡ଼ିଆ ଭାଷାରେ ଲେଖାଯାଇଛି।
தமிழ்: இது தமிழ் மொழி.
ភាសាខ្មែរ៖ ឃ្លានេះជាភាសាខ្មែរ។
한국어: 이 글은 한국어입니다.
日本語: この文章は日本語です。
中文(简体):这些文字是中文。
中文(繁體):這些文字是中文。
עברית: הטקסט הזה בעברית.
العربية: هذا النّص عربي.
فارسی: این متن فارسی است.
ئۇيغۇرچە / Uyghurche: بۇلار ئۇيغۇرچە.
Suppressing the leading label of the language name:
To suppress the language name heading the content (because it is already part of it):
<div class="multilingual">
{{ls|en|This new text is '''English'''.|label=no}}
{{ls|fr|Cet ancien texte est en '''français'''.|label=no}}
{{ls|it|Questo vecchio testo è '''Italiano'''.|label=no}}
{{ls|nl|Deze oude tekst is in het '''Nederlands'''.|label=no}}
</div>
This new text is English.
Cet ancien texte est en français.
Questo vecchio testo è Italiano.
Deze oude tekst is in het Nederlands.
Outdated translations:
To mark a translation as outdated:
<div class="multilingual">
{{ls|en|This new text is English.}}
{{ls|fr|Cet ancien texte est en français.|update=en}}
{{ls|it|Questo vecchio testo è Italiano.|update=en}}
{{ls|nl|Deze oude tekst is in het Nederlands.|update=en}}
</div>
English: This new text is English.
Français : Cet ancien texte est en français. [Template:Ls/update needed : en]
Italiano: Questo vecchio testo è Italiano. [Template:Ls/update needed: en]
Nederlands: Deze oude tekst is in het Nederlands. [Template:Ls/update needed: en]
Customized appearance:
To customize the appearance using CSS:
<div class="multilingual">
{{ls|en|This text is English.|CSS-box=background:#000; color:#FFF;}}
{{ls|en|This text is English.|CSS-label=background:#000; color:#FFF;}}
{{ls|fr|Ce texte est en français.|CSS-box=background:#000; color:#FFF;}}
{{ls|fr|Ce texte est en français.|CSS-label=background:#000; color:#FFF;}}
{{ls|it|Questo testo è Italiano.|CSS-box=background:#000; color:#FFF;}}
{{ls|it|Questo testo è Italiano.|CSS-label=background:#000; color:#FFF;}}
{{ls|nl|Deze tekst is in het Nederlands.|CSS-box=background:#000; color:#FFF;}}
{{ls|nl|Deze tekst is in het Nederlands.|CSS-label=background:#000; color:#FFF;}}
</div>
English: This text is English.
English: This text is English.
Français : Ce texte est en français.
Français : Ce texte est en français.
Italiano: Questo testo è Italiano.
Italiano: Questo testo è Italiano.
Nederlands: Deze tekst is in het Nederlands.
Nederlands: Deze tekst is in het Nederlands.
Use of span boxes:
To mark a translation in a header:
<div class="multilingual">
{{ls|en|This new text is English.|label=no|tag=span}}
{{ls|it|Questo vecchio testo è Italiano.|label=no|tag=span}}
</div>

This new text is English. Questo vecchio testo è Italiano.

See also: