locale

toc
<mm:locale>

Sets a locale. Tags living in its body can request the Locale from it, if they need it. A `locale' is more or less like a `language', but it is a little more. E.g. when formatting a date it is needed to know what the conventions are for the order of the fields, and what kind of characters to use to separate them. Another example is the formatting of numbers, which is also ruled by `locale' conventions.

See JavaDoc for Locale class (A little technical, but at least you'll find links to possible languages and countries, and another short description of what a Locale actually is).

Also the fmt tags of JSTL will recognize this setting (since mmbase 1.8).

Since 1.7 there is also a content tag, which is an extension of the locale tag. You could probably just as well use only an mm:content.

The exceptional value 'client' for the 'language' will set the locale to the preference specified by the client.

see alsocloud | time | content
attributes
  • language
    A two letter language code according to ISO 639, or 'client'. If not country attribute is given, then this attribute can also contain the country and variant, like in xml:lang attributes.
    nl
    en
    nl-BE
    en-GB
  • country
    A two letter country code according to ISO 3166.
    BE
    GB
  • variant (since: MMBase-1.8)
    Vendor specific locale variant.
  • timezone (since: MMBase-1.8.1)
    The time-zone for which the time must be shown. Defaults to the server's time-zone.
    Europe/AmsterdamCentral European Time
  • jspvar
    A jspvar of type Locale can be created.
example 1
<font color="red">A few cool datetime results:</font><br />
<mm:import id="langs" vartype="list">es,de,it,nl,zh,ja,ar,el,he,ru</mm:import>
<mm:aliaslist referid="langs">
<mm:locale language="$_"><mm:time time="now" format=":FULL.FULL" /></mm:locale><br />
</mm:aliaslist>
<font color="red">Only a date:</font><br />
<mm:locale language="fr"><mm:time time="now" format=":LONG" /></mm:locale><br />
<font color="red">Only a time:</font><br />
<mm:locale language="nl"><mm:time time="now" format=":.MEDIUM" /></mm:locale><br />
<font color="red">SimpleDateFormat:</font><br />
<mm:locale language="pl">:<mm:time time="now" format="MMMM yyyy" /></mm:locale><br />
A few cool datetime results:
jueves 23 de mayo de 2013 23H25' CEST
Donnerstag, 23. Mai 2013 23:25 Uhr MESZ
giovedì 23 maggio 2013 23.25.12 CEST
donderdag 23 mei 2013 23:25:12 uur CEST
2013年5月23日 星期四 下午11时25分12秒 CEST
2013年5月23日 23時25分12秒 CEST
23 مايو, 2013 CEST 11:25:12 م
Πέμπτη, 23 Μάϊος 2013 11:25:12 μμ CEST
23:25:12 CEST יום חמישי 23 מאי 2013
23 Май 2013 г. 23:25:12 CEST
Only a date:
23 mai 2013
Only a time:
23:25:12
SimpleDateFormat:
:maj 2013