Deprecation: #108963 - Deprecate PageRenderer->addInlineLanguageDomain()
See forge#108963
Description
\TYPO3\ has been
deprecated in favor of importing JavaScript modules, as introduced in
Feature: #108941 - Provide language labels as virtual JavaScript modules.
Impact
Extension developers can now use labels in JavaScript components without requiring labels to be preloaded globally or per module. This reduces the risk of missing labels and simplifies developer workflows.
Affected installations
The deprecated method was introduced in TYPO3 v14.1. This means that only
installations that use
add in TYPO3 v14.1 or later
are affected.
Migration
The call to
Page can be removed. In
the JavaScript code, add a module import that imports from the
'~labels/' prefix.
Before:
$pageRenderer->addInlineLanguageDomain('core.bookmarks');
import { html } from 'lit';
import { lll } from '@typo3/core/lit-helper.js';
html`<p>{lll('core.bookmarks:groupType.global')}</p>`
After:
import { html } from 'lit';
// Import labels from language domain "core.bookmarks"
import labels from '~labels/core.bookmarks';
// Use label
html`<p>{labels.get('groupType.global')}</p>`