Locale Example

The content of the locale macro is localized using the culture specified on the Locale macro. The following sample show a date time formatted in different cultures. Please note that outside the macro, the default channel culture is used which in the case of the example is en-us.

Smartsite SXML CopyCode image Copy Code
{buffer.set(date, datetime.getdate(1980, 3, 23, 9, 42, 21))}

<se:pagetranslations id="cultureinfo" whitespace="simpleformat">
    <se:collection>        
        <se:member name="details">
            Name: {locale.getname()}<br/>
            Display Name: {locale.getdisplayname()}<br/>
            LCID: {locale.getlcid()} <br/>
        </se:member>
    </se:collection>
</se:pagetranslations>

<se:locale culture="en-us">
{translation.cultureinfo.details()}
{locale.formatlongdatelongtime($date)}
</se:locale>
<hr />
<se:locale culture="nl-nl">
{translation.cultureinfo.details()}
{locale.formatlongdatelongtime($date)}
</se:locale>
<hr />
<se:locale culture="fr-fr">
{translation.cultureinfo.details()}
{locale.formatlongdatelongtime($date)}
</se:locale>
<hr />
{translation.cultureinfo.details()}
{locale.formatlongdatelongtime($date)}
Example Result CopyCode image Copy Code
Name: en-US<br />
Display Name: English (United States)<br />
LCID: 1033 <br />

Sunday, March 23, 1980 09:42:21

<hr />


Name: nl-NL<br />
Display Name: Dutch (Netherlands)<br />
LCID: 1043 <br />

zondag 23 maart 1980 09:42:21

<hr />


Name: fr-FR<br />
Display Name: French (France)<br />
LCID: 1036 <br />

dimanche 23 mars 1980 09:42:21

<hr />

Name: en-US<br />
Display Name: English (United States)<br />
LCID: 1033 <br />

Sunday, March 23, 1980 09:42:21