PHPackages                             belsignum/languagemodes - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. belsignum/languagemodes

ActiveTypo3-cms-extension[Localization &amp; i18n](/categories/localization)

belsignum/languagemodes
=======================

Change languages modes - 'free, fallback, strict' individually for pages

12.0.1(3mo ago)062GPL-2.0-or-laterPHP

Since Mar 31Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/Andreas-Sommer/languagemodes)[ Packagist](https://packagist.org/packages/belsignum/languagemodes)[ RSS](/packages/belsignum-languagemodes/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

Belsignum Language Modes Extension
==================================

[](#belsignum-language-modes-extension)

This TYPO3 extension allows you to dynamically override the `fallbackType` for `SiteLanguage` **per page and language** at runtime.

🧩 Features
----------

[](#-features)

- Define language fallback behavior (`free`, `fallback`, `strict`) per language version of each page
- Fully compatible with TYPO3 v12
- Uses `SiteFinder` and `SiteConfiguration` XCLASS for clean and early injection
- Modifies both `SiteLanguage` and `LanguageAspect` at runtime
- Configuration is cached safely and applies consistently across the TYPO3 request lifecycle
- No core patch required since v12

🔧 How it works
--------------

[](#-how-it-works)

- A `select` field is added to the `pages` table (`tx_languagemodes_mode`)
- This field is **only visible in translated pages** (i.e., `sys_language_uid > 0`)
- When a page is resolved, the SiteFinder XCLASS loads the language-specific configuration from the DB and replaces the SiteLanguage for the current request
- Additionally, the `LanguageAspect` is updated to ensure proper behavior in content fetching and overlays

🛠 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require belsignum/languagemodes
```

⚙️ Configuration
----------------

[](#️-configuration)

No special configuration needed. Once the extension is installed:

- Open the page module
- Switch to a language version of a page (not the default language)
- You will see a select field labeled `Language fallback mode` with the options:
    - Free
    - Fallback
    - Strict

If no value is selected, the global fallback behavior from the site config applies.

🧠 Why we use `SiteFinder` / `SiteConfiguration` – and not Middleware, Events or Hooks
-------------------------------------------------------------------------------------

[](#-why-we-use-sitefinder--siteconfiguration--and-not-middleware-events-or-hooks)

TYPO3 offers multiple ways to influence site and language resolution. After extensive evaluation, this extension **intentionally avoids** Middleware or Event-based approaches for the following reasons:

### ❌ Why not Middleware?

[](#-why-not-middleware)

- Middlewares like `typo3/cms-frontend/site` resolve the site and language context **before** any custom fallback logic can take effect.
- Injecting a modified `SiteLanguage` or `LanguageAspect` into `$GLOBALS['TYPO3_REQUEST']` **after site resolution** has **no influence** on the request lifecycle.
- Custom middlewares cannot safely override fallbackType without risk of unstable or version-dependent behavior.

### ❌ Why not Events?

[](#-why-not-events)

- Events such as `BootCompletedEvent` or `SiteConfigurationBeforeWriteEvent` are either:
    - **Too early** (before routing and site resolution),
    - **Too late** (after the fallback logic has already been applied),
    - or only trigger on configuration **write operations**, not at runtime.
- As of TYPO3 v12, there is **no `ModifyResolvedSiteLanguageEvent`** or similar that would allow request-based manipulation of fallback behavior.

### ❌ Why not Hooks?

[](#-why-not-hooks)

- While legacy hooks like `configArrayPostProc` are still technically available in TYPO3 v12, they no longer have meaningful influence on language resolution.
- These hooks operate after `TSFE` initialization and only affect TypoScript-based values like `config.sys_language_mode`.
- Since TYPO3 v9+, language fallback is controlled via `SiteLanguage` and `Context`, not TypoScript.
- Hook-based solutions are not reliable in modern TYPO3 setups and are not suitable for manipulating `SiteLanguage` or `LanguageAspect`.

➡️ Therefore, we avoid using legacy hooks and rely on early runtime overrides instead.

### ✅ Why `SiteFinder` and `SiteConfiguration` XCLASSing is used

[](#-why-sitefinder-and-siteconfiguration-xclassing-is-used)

- `SiteFinder` and `SiteConfiguration` are part of the early site and language resolution process.
- By XCLASSing both, the extension can:
    - Load the language-specific configuration from the database
    - Dynamically set the `fallbackType` per language and page
    - Safely inject a new `SiteLanguage` and corresponding `LanguageAspect` into the runtime context
- This approach is:
    - Core-compliant
    - Fully runtime-safe
    - Patch-free
    - Compatible with TYPO3 v12+

🧑‍💻 Credits
-----------

[](#‍-credits)

Developed by [Belsignum](https://www.belsignum.com) with ❤️ for TYPO3 integrators.

📝 License
---------

[](#-license)

Licensed under the [MIT License](https://opensource.org/licenses/MIT)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance78

Regular maintenance activity

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~147 days

Total

3

Last Release

118d ago

Major Versions

v10.x-dev → 12.0.02025-04-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/03d3db83203d6cf93e3b12cb86a8bd2dafe17669d605933d352c34eb607bea0e?d=identicon)[belsignum](/maintainers/belsignum)

---

Top Contributors

[![Andreas-Sommer](https://avatars.githubusercontent.com/u/30976558?v=4)](https://github.com/Andreas-Sommer "Andreas-Sommer (6 commits)")

### Embed Badge

![Health badge](/badges/belsignum-languagemodes/health.svg)

```
[![Health](https://phpackages.com/badges/belsignum-languagemodes/health.svg)](https://phpackages.com/packages/belsignum-languagemodes)
```

###  Alternatives

[web-vision/wv_deepltranslate

This extension provides option to translate content element, and TCA record texts to DeepL supported languages using DeepL API services with TYPO3 CMS

32283.1k](/packages/web-vision-wv-deepltranslate)[web-vision/deepltranslate-core

This extension provides option to translate content element, and TCA record texts to DeepL supported languages using DeepL API services with TYPO3 CMS

3289.7k2](/packages/web-vision-deepltranslate-core)[leuchtfeuer/locate

Locate - The users country, preferred language and other facts will be detected. Depending on configurable rules the user can be redirected to other languages or pages. Locate also provides geo blocking for configurable pages in configurable countries.

1182.8k](/packages/leuchtfeuer-locate)[undefined/translate-locallang

Backend Module for creating and editing of language files (locallang.xlf).

12256.9k2](/packages/undefined-translate-locallang)[georgringer/extbase-with-no-l10n-parent

Show records in extbase if those got a different language defined then -1 (all) or 0 (default) and no language parent

12103.4k](/packages/georgringer-extbase-with-no-l10n-parent)[evoweb/ew-llxml2xliff

Convert locallang.xml/.php files to .xlf

1045.7k1](/packages/evoweb-ew-llxml2xliff)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
