Locale GetCulture, SetLocale Example
This example demonstrates the usage of the locale.setlocale() and locale.getculture() vipers. Within each of the two switch macros the current culture locale.getculture() is compared with a specific culture, locale.getculture(1033) and locale.getculture(1043) respectively.
Smartsite SXML | Copy Code |
---|---|
{locale.setlocale("en-US")} <se:switch> <se:case expression="locale.getculture()==locale.getculture(1033)"> <p>en-US (1033) is de default culture</p> </se:case> <se:case expression="locale.getculture()==locale.getculture(1043)"> <p>nl-NL (1043) is de default culture</p> </se:case> </se:switch> {locale.setlocale("nl-NL")} <se:switch> <se:case expression="locale.getculture()==locale.getculture(1033)"> <p>en-US (1033) is de default culture</p> </se:case> <se:case expression="locale.getculture()==locale.getculture(1043)"> <p>nl-NL (1043) is de default culture</p> </se:case> </se:switch> |
Example Result | Copy Code |
---|---|
<p>en-US (1033) is de default culture</p> <p>nl-NL (1043) is de default culture</p> |