Bug #93889

Cannot modify language pack remote base URL

Added by Xavier Perseguers 8 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Should have
Category:
Localization
Target version:
Start date:
2021-04-09
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

Since the move to PSR-14 one cannot modify the language pack remote base URL.

This is following event:

TYPO3\CMS\Install\Service\Event\ModifyLanguagePackRemoteBaseUrlEvent

The reason is that the listener provider TYPO3\CMS\Core\EventDispatcher\ListenerProvider has an empty list of initialized listeners (member listeners), most probably in relation with the context (Install Tool).

Configuration

In EXT:yourExt/Configuration/Settings.yaml:

  VENDOR\YourExt\EventListener\InstallServiceEventListener:
    tags:
      - name: event.listener
        identifier: 'VENDOR/yourExt'
        method: 'modifyLanguagePackRemoteBaseUrl'
        event: TYPO3\CMS\Install\Service\Event\ModifyLanguagePackRemoteBaseUrlEvent

Sample class VENDOR\YourExt\EventListener\InstallServiceEventListener:

namespace VENDOR\YourExt\EventListener;

use TYPO3\CMS\Core\Http\Uri;
use TYPO3\CMS\Install\Service\Event\ModifyLanguagePackRemoteBaseUrlEvent;

class InstallServiceEventListener
{

    /**
     * @param ModifyLanguagePackRemoteBaseUrlEvent $event
     */
    public function modifyLanguagePackRemoteBaseUrl(ModifyLanguagePackRemoteBaseUrlEvent $event): void
    {
        if ($event->getPackageKey() === 'yourExt') {
            $event->setBaseUrl(new Uri('https://www.example.com/packages/'));
        }
    }

}

Expected

The method is invoked.

What happens

The method is not invoked as no listeners seems to be registered in that context.


Related issues

Related to TYPO3 Core - Bug #66928: Cannot use custom mirror URL anymore for XLIFFClosed2015-05-13

Actions
Related to TYPO3 Core - Feature #50467: Support custom translation servers for extensionsClosedXavier Perseguers2013-07-26

Actions

Also available in: Atom PDF