Wiki source code of Language Macro
Version 24.1 by Marius Dumitru Florea on 2016/11/01
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | = Example = | ||
2 | == Code == | ||
3 | {{code}} | ||
4 | {{language codes='de, fr, it, lv, nl, ru, sv, zh'/}} | ||
5 | {{/code}} | ||
6 | |||
7 | == Result == | ||
8 | {{language codes='de, fr, it, lv, nl, ru, sv, zh'/}} | ||
9 | |||
10 | = Parameters | ||
11 | |||
12 | |= Parameter name |= Description | ||
13 | | codes | indicates the code list for the language | ||
14 | |||
15 | Codes that can be used: | ||
16 | {{velocity}} | ||
17 | |= Code |= Flag |= Language name | ||
18 | #foreach($attachment in $doc.attachmentList) | ||
19 | #set($locale = $attachment.filename.substring(0, $attachment.filename.indexOf('.')).replace('-', '_')) | ||
20 | | $locale | image:$attachment.filename | $!{languages.get($locale).get(0)} | ||
21 | #end | ||
22 | {{/velocity}} | ||
23 | |||
24 | == References == | ||
25 | This macro uses [[http://www.famfamfam.com/lab/icons/flags/]] icons and the language names are based on [[http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt]]. | ||
26 | XWiki supported languages are in concordance with http://l10n.xwiki.org/xwiki/bin/view/L10N/Flags |