Difference between revisions of "Category:Language aware Templates"

From Lazarus wiki
Jump to navigationJump to search
(Description with examples)
 
(note in Polish)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This category shall contain all Wiki templates which are language aware and show texts which are translated to the transcluding page.
+
'''English:''' This category shall contain all Wiki templates which are language aware and show texts which are translated to the transcluding page.
 +
 
 +
'''Deutsch:''' Diese Kategorie enthält alle Wiki-Vorlagen, die sprachbekannt sind und Texte zeigen, die auf die transpinierende Seite übersetzt werden.
 +
 
 +
'''Français:''' Cette catégorie doit contenir tous les modèles Wiki qui sont connaissaient la langue et afficher les textes qui sont traduits à la page de transcludage.
 +
 
 +
'''Język polski:''' Ta kategoria powinna zawierać wszystkie szablony Wiki, które są świadome języka i pokazują teksty przetłumaczone tak, jak strona transkludująca.
  
 
== Example ==
 
== Example ==
Line 12: Line 18:
 
| Warning
 
| Warning
 
}}</pre>
 
}}</pre>
 +
 +
 +
[[Category:Wiki]]

Latest revision as of 12:57, 12 January 2022

English: This category shall contain all Wiki templates which are language aware and show texts which are translated to the transcluding page.

Deutsch: Diese Kategorie enthält alle Wiki-Vorlagen, die sprachbekannt sind und Texte zeigen, die auf die transpinierende Seite übersetzt werden.

Français: Cette catégorie doit contenir tous les modèles Wiki qui sont connaissaient la langue et afficher les textes qui sont traduits à la page de transcludage.

Język polski: Ta kategoria powinna zawierać wszystkie szablony Wiki, które są świadome języka i pokazują teksty przetłumaczone tak, jak strona transkludująca.

Example

Page Installing Lazarus uses {{Warning|Warning text}} and will show up the text Warning: Warning text whereas the German page Installing Lazarus/de uses {{Warning|Text der Warnung}} which will show up as 'Warnung: Text der Warnung. Both pages use the same template.

How To use in templates

This expression {{#titleparts:{{PAGENAME}}| | -1}} retrieves the language part of the page (e.g. de for German). The {{#switch: statement gets the actual string depending on the language. If no language is available, the default string will be shown.

{{#switch:{{#titleparts:{{PAGENAME}}| | -1}}
| de= Warnung
| en= Warning
| fr= Avertissement
| Warning
}}