Skip to content

Conversation

@koehnlein
Copy link

First of all, thanks for all of your DeepL extensions, they help me a lot.

It would be pretty nice for my use case to have an event, when the glossary sync was done.

Copy link
Member

@sbuerk sbuerk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @koehnlein for the pull-request.

In general I don't hestitate to accept an event on places if that helps others, but in this case I would abstain from appling and accepting this directly.

The reason is, that my collegue is preparing the deepltranslate-core towards API v3 and I don't have an oversight what changes may required in this area and if the event make sense in the current form. We keep the pull-request open so we can revisit this when we have a deeper insight where the road is going to be layed out.

Additionally, we need to check if a more finer event would also make sense to complete this and further if more context data in the event would be reasonable or use-full.

Beside that, and because it's missing in the pull-request/commit message, what is your exact use-case for what you are requesting this event. That would help us to understand your need and to help out if this is really the right way for your use-case or if we should provide something else.

So please be aware that this may eventually lay around the one or other day (week).

ClientInterface $client,
GlossaryRepository $glossaryRepository
GlossaryRepository $glossaryRepository,
EventDispatcher $eventDispatcher,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
EventDispatcher $eventDispatcher,
EventDispatcherInterface $eventDispatcher,

It's common practice to use the EventDispatcherInterface as type declaration and not the concrete implementation. We strive to use interfaces over concrete implementation as much as possible, and refactor the code base over time if not
breaking over time - and if we have the time for it.

For new code we are having a eye on such things.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it

use DeepL\GlossaryLanguagePair;
use Doctrine\DBAL\Driver\Exception;
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
use TYPO3\CMS\Core\EventDispatcher\EventDispatcher;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use TYPO3\CMS\Core\EventDispatcher\EventDispatcher;
use Psr\EventDispatcher\EventDispatcherInterface;

Sorting needs to be checked after applining the change:

Build/Scripts/runTests.sh -s cgl

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it

*/
final class GlossarySyncDone
{
public function __construct(public readonly int $pageId)
Copy link
Member

@sbuerk sbuerk Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to talk with my collegue, but I guess we are stating with private properties for now and using getter/getter&setters .. needs to be revisited and rethinked.

Coming back on this later.

Copy link
Author

@koehnlein koehnlein Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@koehnlein koehnlein force-pushed the feature/event-glossary-sync-done branch from 65bcb65 to aea8790 Compare November 5, 2025 08:16
@koehnlein
Copy link
Author

Beside that, and because it's missing in the pull-request/commit message, what is your exact use-case for what you are requesting this event. That would help us to understand your need and to help out if this is really the right way for your use-case or if we should provide something else.

I would like to introduce further processings with glossary entries and set flags, depending if the were change in TYPO3 (I to this with a DataHandler hook) or if they are also synced to DeepL. For this second part, I need this event with the information which page ID was synced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants