Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Documentation/Conditions/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,13 @@ siteLanguage()
Returns the language ID as an integer.

:typoscript:`siteLanguage("locale")`
Returns the current locale as a string, for example `en-GB` or `de-DE`.
Returns the current locale as :php:`\TYPO3\CMS\Core\Localization\Locale`.
You can call all public methods of the object, for example
:typoscript:`siteLanguage("locale").getName()` returns `en-GB` or `de-DE`.

**Note**: In TYPO3 v12 there was an unintentional breaking change,
whereby an object and not a string is returned.
A future TYPO3 release may address implementing a shortcut for this.

:typoscript:`siteLanguage("base")`
Returns the configured base URL as a string.
Expand Down Expand Up @@ -1309,7 +1315,7 @@ siteLanguage()
.. code-block:: typoscript
:caption: EXT:site_package/Configuration/TypoScript/setup.typoscript

[siteLanguage("locale") == "de-CH"]
[siteLanguage("locale").getName() == "de-CH"]
page.10.value = This site has the locale "de_CH" or "de_CH.utf8"
[END]

Expand Down
2 changes: 1 addition & 1 deletion Documentation/PageTsconfig/Rte.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ config.contentsLanguageDirection
RTE.config.contentsLanguageDirection = rtl

# except for the following language:
[siteLanguage("locale") == "en_US"]
[siteLanguage("locale").getName() == "en-US"]
RTE.config.contentsLanguageDirection = ltr
[END]

Expand Down
Loading