Project

General

Profile

Actions

Feature #103905

open

Make default language uid configurable

Added by André Buchmann 6 months ago. Updated 6 months ago.

Status:
Under Review
Priority:
Should have
Category:
-
Start date:
2024-05-24
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
nightmare
Sprint Focus:

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 @Soren Malling
(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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #104064: English is always taken as default xlf languageClosed2024-06-11

Actions
Actions #1

Updated by Gerrit Code Review 6 months ago

  • Status changed from New to Under Review

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84338

Actions #2

Updated by André Buchmann 6 months ago

  • Description updated (diff)
Actions #3

Updated by Garvin Hicking 5 months ago

  • Related to Bug #104064: English is always taken as default xlf language added
Actions

Also available in: Atom PDF