Attention
TYPO3 v12 has reached end-of-life as of April 30th 2026 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v12 here: TYPO3 ELTS.
ModifyLanguagePacksEvent
New in version 12.2
The PSR-14 event
\TYPO3\
allows to ignore extensions or individual language packs for extensions when
downloading language packs.
The options of the
language: command can be used to further
restrict the download (ignore additional extensions or download only certain
languages), but not to ignore decisions made by the event.
Example
Registration of the event:
services:
# Place here the default dependency injection configuration
MyVendor\MyExtension\Install\EventListener\MyEventListener:
tags:
- name: event.listener
identifier: 'my-extension/modify-language-packs'
Read how to configure dependency injection in extensions.
An implementation of the event listener:
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\Install\EventListener;
use TYPO3\CMS\Install\Service\Event\ModifyLanguagePacksEvent;
final class MyEventListener
{
public function __invoke(ModifyLanguagePacksEvent $event): void
{
$extensions = $event->getExtensions();
foreach ($extensions as $key => $extension) {
// Do not download language packs from Core extensions
if ($extension['type'] === 'typo3-cms-framework') {
$event->removeExtension($key);
}
}
// Remove German language pack from EXT:styleguide
$event->removeIsoFromExtension('de', 'styleguide');
}
}