Search code examples
typo3typo3-9.x

Frontent localization settings in TYPO3: config.yaml vs. TypoScript


In the site configuration ((config|typo3conf)/sites/<sitename>/config.yaml), it is possible to configure the languages and choose a "Fallback type", e.g. "strict" or "fallback". I believe, this corresponds to the TypoScript setting config.sys_language_mode.

enter image description here

Now, how do the TypoScript settings and the settings in the site config.yaml work together?

On the Site handling > Add languages page, there is the following hint:

Used to older TYPO3 versions? The following TypoScript settings will be set based on config.yaml - you don’t need to have them in your TypoScript template:

  • config.language
  • config.locale_all
  • config.htmlTag_dir
  • config.htmlTag_langKey
  • config.sys_language_uid
  • config.sys_language_mode
  • config.sys_language_isocode
  • config.sys_language_isocode_default

What does this mean? The TS settings will take on the values of the yaml config, but can still be overridden with TypoScript? Which settings are used where?

What happens if you are using for example the bootstrap_package which sets config.sys_language_mode = content_fallback but you want to disable this setting so it uses what is configured in the config.yaml (for example, "strict")?

What happens if you do

config sys_language_mode >

in TypoScript? Does it use the config.yaml setting?

Why do the TypoScript settings still exist?

What is the recommended approach here, do you still need to tamper with the TS settings at all?

(My background is, I have an updated TYPO3 9 site, mostly, it works nicely, but when it comes to the language settings there are still some minor bugs on the site and I am still working on cleaning up the TypoScript settings. Also, I would like to understand this better and where the configuration is moving towards so I do not have to clean up twice.)


Solution

  • The settings you mentioned are all deprecated in TYPO3 Version 9 and have been removed in Version 10.

    The corresponding changelog is here:
    https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.0/Breaking-87193-DeprecatedFunctionalityRemoved.html

    and on the long page is stated:

    The following TypoScript options have been dropped:

    config.concatenateJsAndCss
    config.defaultGetVars
    config.htmlTag_langKey
    config.htmlTag_dir
    config.language
    config.language_alt
    config.locale_all
    config.sys_language_isocode
    config.sys_language_isocode_default
    config.sys_language_mode
    config.sys_language_overlay
    config.sys_language_uid
    ...

    Related to version 9 your question might be useful as it has to be expected perhaps that some functionality might correlate. I never verified it, so I can't give an answer on it, but for Version 10 you can safely remove all those settings, for the case of any update.