Feature: #107105 - Introduce expression for accessing site locale
See forge#107105
Description
A new Symfony ExpressionLanguage expression
locale
has been introduced.
This expression allows integrators and developers to directly access the current site locale, which is provided as a locale object. All public methods of this object are available for use.
Have a look at the corresponding documentation for more details: API
Example
[locale().getName() == "en-US"]
page.20.value = bar
[END]
[locale().getCountryCode() == "US"]
page.30.value = foo
[END]
[locale().isRightToLeftLanguageDirection()]
page.40.value = bar
[END]
Copied!
variants:
-
identifier: language-variant-1
condition: 'locale().getName() == "en-US"'
label: 'First name'
Copied!
Impact
Developers can now easily compare the locale of the current site directly
in expression contexts, without the need for using
site
.