Template:Ls/doc: Difference between revisions
Template page
More actions
oc: |
m syntaxhighlight lang="wikitext" |
||
| (20 intermediate revisions by 12 users not shown) | |||
| Line 1: | Line 1: | ||
{{ | {{TemplateBox | ||
|1=1 | |||
|1d=Language code (e. g. <code>en</code>) | |||
|1def= | |||
|1stat=required | |||
==Usage== | |2=2 | ||
{| class=" | |2d=Text in that language | ||
|2def= | |||
|2stat=required | |||
|3=update | |||
|3d=If the language text needs update, then the new text's language code (e. g. <code>en</code>) | |||
|3def= | |||
|3stat=optional- | |||
|4=CSS-box | |||
|4d=CSS style for the whole text | |||
|4def= | |||
|4stat=optional- | |||
|5=CSS-label | |||
|5d=CSS style only for the label ("English:" text) | |||
|5def= | |||
|5stat=optional- | |||
|name=ls | |||
|desc=This template wraps translations for [[Meta:Language select|Language select]], a script which dynamically hides languages when the user's preferred language is available. | |||
|namespace=all | |||
|usergroup=all | |||
|placement= | |||
|usage-notes= | |||
|type= | |||
|example= | |||
|i18n-method=- | |||
|i18n-desc=To translate the "update needed" message, edit {{[[template:snippets/update needed|snippets/update needed]]}}. | |||
|seealso= | |||
|setscats= | |||
|lines= | |||
|shorthand= | |||
|relieson= | |||
}} | |||
== Usage == | |||
{|class="wikitable" style="width:100%" | |||
|- | |- | ||
| < | |width="60%"|<syntaxhighlight lang="wikitext"><div class="multilingual"> | ||
{{ls|en|This text is English}} | {{ls|de|Dieser Text ist auf Deutsch.}} | ||
{{ls|fr| | {{ls|diq|Eno nuşte zazakiyo.}} | ||
{{ls| | {{ls|en|This text is in English.}} | ||
</div></ | {{ls|fr|Ce texte est en français.}} | ||
|style="font-size:3em;"| → | {{ls|mk|Овој текст е на македонски јазик.}} | ||
| <div class="multilingual"> | {{ls|ar|هذا النص القديم في اللغة العربية.}} | ||
{{ls|en|This text is English}} | </div></syntaxhighlight> | ||
{{ls|fr| | |style="font-size:3em;"|→ | ||
{{ls| | |width="40%"|<div class="multilingual"> | ||
{{ls|de|Dieser Text ist auf Deutsch.}} | |||
{{ls|diq|Eno nuşte zazakiyo.}} | |||
{{ls|en|This text is in English.}} | |||
{{ls|fr|Ce texte est en français.}} | |||
{{ls|mk|Овој текст е на македонски јазик.}} | |||
{{ls|ar|هذا النص القديم في اللغة العربية.}} | |||
</div> | </div> | ||
|} | |} | ||
=== Parameters === | |||
;Outdated translations | |||
===Parameters=== | |||
; Outdated translations | |||
:To mark a translation as outdated: | :To mark a translation as outdated: | ||
:{| class=" | :{|class="wikitable" style="width:100%" | ||
|- | |- | ||
| < | |width="60%"|<syntaxhighlight lang="wikitext"><div class="multilingual"> | ||
{{ls| | {{ls|de|Dieser Text ist auf Deutsch}} | ||
{{ls| | {{ls|diq|Eno nuşte zazakiyo.}} | ||
{{ls|en|This new text is English}} | {{ls|en|This new text is English}} | ||
{{ls|fr|This | {{ls|fr|Cet ancien texte est en français.|update=en}} | ||
{{ls|mk|Овој стар текст е на македонски јазик|update=en}} | |||
{{ls|ar|هذا النص القديم في اللغة العربية.|update=en}} | |||
</div></syntaxhighlight> | |||
|style="font-size:3em;"|→ | |||
|width="40%"|<div class="multilingual"> | |||
{{ls|de|Dieser Text ist auf Deutsch.}} | |||
{{ls|diq|Eno nuşte zazakiyo.}} | |||
{{ls|en|This new text is in English.}} | |||
{{ls|fr|Cet ancien texte est en français.|update=en}} | |||
{{ls|mk|Овој стар текст е на македонски јазик|update=en}} | |||
{{ls|ar|هذا النص القديم في اللغة العربية.|update=en}} | |||
</div> | </div> | ||
|} | |} | ||
;Customize appearance | |||
; | :To customize the appearance using CSS: | ||
: To customize the appearance using CSS: | :{|class="wikitable" style="width:100%" | ||
:{| class=" | |||
|- | |- | ||
| < | |width="60%"|<syntaxhighlight lang="wikitext"><div class="multilingual"> | ||
{{ls|en|This text is English|CSS-box=background:#000; color:#FFF;}} | {{ls|de|Dieser Text ist auf Deutsch.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} | ||
{{ls|fr| | {{ls|diq|Eno nuşte zazakiyo.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} | ||
</div></ | {{ls|en|This text is in English.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} | ||
|style="font-size:3em;"| → | {{ls|fr|Ce texte est en français.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} | ||
| <div class="multilingual"> | {{ls|mk|Овој текст е на македонски јазик.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} | ||
{{ls|en|This text is English|CSS-box=background:#000; color:#FFF;}} | {{ls|ar|هذا النص باللغة العربية.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} | ||
{{ls|en| | </div></syntaxhighlight> | ||
|style="font-size:3em;"|→ | |||
|width="40%"|<div class="multilingual"> | |||
{{ls|de|Dieser Text ist auf Deutsch.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} | |||
{{ls|diq|Eno nuşte zazakiyo.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} | |||
{{ls|en|This text is in English.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} | |||
{{ls|fr|Ce texte est en français.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} | |||
{{ls|mk|Овој текст е на македонски јазик.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} | |||
{{ls|ar|هذا النص باللغة العربية.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} | |||
</div> | </div> | ||
|} | |} | ||
<!-- template categories --> | <!-- template categories --> | ||
{{DEFAULTSORT:Ls}} | |||
<includeonly> | <includeonly> | ||
[[Category:Tools and scripts]] | [[Category:Tools and scripts]] | ||
</includeonly> | </includeonly> | ||
Latest revision as of 19:54, 8 June 2023
This template wraps translations for Language select, a script which dynamically hides languages when the user's preferred language is available.
Usage
{{ls |1= |2= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | Language code (e. g. en) | empty | required | |
2 | Text in that language | empty | required | |
update | If the language text needs update, then the new text's language code (e. g. en) | empty | optional | |
CSS-box | CSS style for the whole text | empty | optional | |
CSS-label | CSS style only for the label ("English:" text) | empty | 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
Localization
This template is not intended to be localized.
To translate the "update needed" message, edit {{snippets/update needed}}.
Usage
<div class="multilingual">
{{ls|de|Dieser Text ist auf Deutsch.}}
{{ls|diq|Eno nuşte zazakiyo.}}
{{ls|en|This text is in English.}}
{{ls|fr|Ce texte est en français.}}
{{ls|mk|Овој текст е на македонски јазик.}}
{{ls|ar|هذا النص القديم في اللغة العربية.}}
</div>
|
→ | Deutsch: Dieser Text ist auf Deutsch.
Zazaki: Eno nuşte zazakiyo.
English: This text is in English.
Français : Ce texte est en français.
Македонски: Овој текст е на македонски јазик.
العربية : هذا النص القديم في اللغة العربية.
|
Parameters
- Outdated translations
- To mark a translation as outdated:
<div class="multilingual"> {{ls|de|Dieser Text ist auf Deutsch}} {{ls|diq|Eno nuşte zazakiyo.}} {{ls|en|This new text is English}} {{ls|fr|Cet ancien texte est en français.|update=en}} {{ls|mk|Овој стар текст е на македонски јазик|update=en}} {{ls|ar|هذا النص القديم في اللغة العربية.|update=en}} </div>
→ Deutsch: Dieser Text ist auf Deutsch.Zazaki: Eno nuşte zazakiyo.English: This new text is in English.Français : [update needed : en] Cet ancien texte est en français.Македонски: [update needed: en] Овој стар текст е на македонски јазикالعربية : [update needed : en] هذا النص القديم في اللغة العربية.
- Customize appearance
- To customize the appearance using CSS:
<div class="multilingual"> {{ls|de|Dieser Text ist auf Deutsch.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} {{ls|diq|Eno nuşte zazakiyo.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} {{ls|en|This text is in English.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} {{ls|fr|Ce texte est en français.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} {{ls|mk|Овој текст е на македонски јазик.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} {{ls|ar|هذا النص باللغة العربية.|CSS-box=background:#CCF;color:#000;|CSS-label=background:#00F;color:#FFF;}} </div>
→ Deutsch: Dieser Text ist auf Deutsch.Zazaki: Eno nuşte zazakiyo.English: This text is in English.Français : Ce texte est en français.Македонски: Овој текст е на македонски јазик.العربية : هذا النص باللغة العربية.