Template:Lang: Difference between revisions

Jump to navigation Jump to search
Doc
m (Oops. Now with <noinclude> around the template categories)
(Doc)
 
Line 1: Line 1:
<span lang="{{{1}}}" {{#if:{{{rtl|}}}|dir="rtl"}}>{{{2}}}</span><noinclude>
<span lang="{{{1}}}" {{#if:{{{rtl|}}}|dir="rtl"}}>{{{2}}}</span><noinclude>
{{Informative template|1=
__NOTOC__
== Goal ==
This template can be used to indicate the language in a span of text to a web browser.
{{inote|While the template can help web browsers find the right font and can help screen readers/text-to-speach browsers, it will usually not introduce a visual difference in the text.}}
== Usage ==
<nowiki>{{</nowiki>'''lang'''<nowiki>|</nowiki>lang<nowiki>|</nowiki>text <nowiki>|</nowiki>''rtl=''<nowiki>}}</nowiki>
All parameters but '''rtl''' are mandatory.
; lang:  Two-letter ISO 639-1 language code for the language of the text.
; text:  Text in that language.
; rtl:  If non-empty the text will be marked as being read right-to-left.
== Examples ==
<nowiki>"Have a wonderful day!" is in Swedish "{{lang|sv|Ha en underbar dag!}}".</nowiki>
"Have a wonderful day!" is in Swedish "{{lang|sv|Ha en underbar dag!}}".
== Technical details ==
The template uses the HTML tag <code>&lt;span lang="" dir="rtl"&gt;</code> to mark that the piece text is in a different language than the rest of the page, and when '''rtl''' is non-empty also that the text is read right-to-left.
== Related templates ==
* {{tl|language icon}} – Will indicate the language in a paragraph to both the reader and the web browser.
}}


[[Category:Undocumented templates]]
[[Category:Language templates]]
[[Category:Language templates]]
</noinclude>
</noinclude>

Navigation menu