---
title: "Feature: #107105 - Introduce expression for accessing site locale"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-107105-1752687611"
source: "Changelog/14.0/Feature-107105-IntroduceExpressionForAccessingSiteLocale.rst"
modified: "2026-09-15T10:46:36+00:00"
---

# Feature: #107105 - Introduce expression for accessing site locale

See [forge#107105](https://forge.typo3.org/issues/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.

For more information, refer to the API documentation:
[API](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Localization/LocalizationApi/Locale.html#api)

## Example

**Using locale() in TypoScript conditions**

```typoscript
[locale().getName() == "en-US"]
    page.20.value = bar
[END]
[locale().getCountryCode() == "US"]
    page.30.value = foo
[END]
[locale().isRightToLeftLanguageDirection()]
    page.40.value = bar
[END]
```

**Using locale() in a form variant definition**

```yaml
variants:
  - identifier: language-variant-1
    condition: 'locale().getName() == "en-US"'
    label: 'First name'
```

## Impact

Developers can now compare or evaluate the site locale directly in expressions,
without using `siteLanguage("locale")`.
