File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1410,7 +1410,13 @@ siteLanguage()
1410
1410
Returns the language ID as an integer.
1411
1411
1412
1412
:typoscript: `siteLanguage("locale") `
1413
- Returns the current locale as a string, for example `en_GB ` or `de_DE `.
1413
+ Returns the current locale as :php: `\T YPO3\C MS\C ore\L ocalization\L ocale `.
1414
+ You can call all public methods of the object, for example
1415
+ :typoscript: `siteLanguage("locale").getName() ` returns `en-GB ` or `de-DE `.
1416
+
1417
+ **Note **: In TYPO3 v12 there was an unintentional breaking change,
1418
+ whereby an object and not a string is returned.
1419
+ A future TYPO3 release may address implementing a shortcut for this.
1414
1420
1415
1421
:typoscript: `siteLanguage("base") `
1416
1422
Returns the configured base URL as a string.
@@ -1461,8 +1467,8 @@ siteLanguage()
1461
1467
.. code-block :: typoscript
1462
1468
:caption: EXT:site_package/Configuration/TypoScript/setup.typoscript
1463
1469
1464
- [siteLanguage("locale") == "de_CH "]
1465
- page.10.value = This site has the locale "de_CH"
1470
+ [siteLanguage("locale").getName() == "de-CH "]
1471
+ page.10.value = This site has the locale "de_CH" or "de_CH.utf8"
1466
1472
[END]
1467
1473
1468
1474
[siteLanguage("title") == "Italy"]
Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ config.contentsLanguageDirection
289
289
RTE.config.contentsLanguageDirection = rtl
290
290
291
291
# except for the following language:
292
- [siteLanguage("locale") == "en_US "]
292
+ [siteLanguage("locale").getName() == "en-US "]
293
293
RTE.config.contentsLanguageDirection = ltr
294
294
[END]
295
295
You can’t perform that action at this time.
0 commit comments