Issue Feature Under Review Orphaned

#103905Make default language uid configurable

André Buchmann 05/24/24, 21:01 updated 11/22/24, 14:26

Description

Once upon a time there was the all mighty sys_language_uid 0.

To support record sharing across multiple sites with different language configurations the “default” language uid should be configurable.

The SiteConfig already supports this behavior as it just returns the first language of the SiteConfiguration.

$site->getDefaultLanguage()->getLanguageId()

—-

*Example Usecase by @sorenmalling*
(Quote from Slack: https://typo3.slack.com/archives/C05D7UF1L8M/p1715761552677479)

University of Copenhagen is eager to share our case and situation and work together with any knowledge, testing etc. to help.
Link to original thread: https://typo3.slack.com/archives/C03AM9R17/p1715684411418909
Original content follows here:
Curious to know about the language handling ( languageId in site settings) and having a default language that is not languageId: 0 )
The site tree only displays pages with sys_language_uid = 0 .
So having multiple sites in a installation, some with danish - languageId: 0 as default and others with english - languageId: 1 requires me to use the “hide default language” (l18n_cfg).
With the concept of languages as entrypoints, and the method getDefaultLanguage on a Site object to take the first language in the array, is it something pointing towards, that the pagetree could handle sites, with a default language different than 0?

This would be one site with danish as default language, english as secondary

base: 'https://cms-distribution.ddev.site/'
languages:
  -
    title: Sundhed
    enabled: true
    locale: da_DK
    hreflang: da-DK
    base: /sund
    websiteTitle: ''
    navigationTitle: Dansk
    flag: dk
    solr_core_read: core_da
    languageId: 0
    piwik_app_id: ''
  -
    title: English
    enabled: true
    locale: en_US
    hreflang: da-DK
    base: /health
    websiteTitle: ''
    navigationTitle: English
    fallbackType: free
    fallbacks: ''
    flag: en-us-gb
    languageId: 1
rootPageId: 3
websiteTitle: 'Site name'

And another site with english as primary/only language is named english-only

base: 'https://cms-distribution.ddev.site/'
contentSecurityPolicies: {  }
languages:
  -
    title: English
    enabled: true
    locale: en_US
    hreflang: ''
    base: /english-only
    websiteTitle: ''
    navigationTitle: English
    fallbackType: free
    fallbacks: ''
    flag: en-us-gb
    languageId: 1
rootPageId: 73
websiteTitle: 'English only'

This last one can not render in the frontend, and the slug field does not show including the base – because there is no languageId: 0
One issue here is, that we have translated announcements living on pid = 0 – if we use languageId: 0 in the english-only site, it will get the announcements in danish, because danish announcements are with sys_language_id: 0

Reviews 1

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". The changes above were merged or abandoned: read them before you start. How to create a patch

Commit message
[FEATURE] Make default language uid configurable Resolves: #103905 Releases: main

History 34