Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add event or other mechanism to add own glossary #340

Open
sypets opened this issue Jun 24, 2024 · 0 comments
Open

[FEATURE] Add event or other mechanism to add own glossary #340

sypets opened this issue Jun 24, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@sypets
Copy link
Contributor

sypets commented Jun 24, 2024

Is your feature request related to a problem? Please describe.

Current solution does not make it possible to use already existing glossary, which was uploaded to DeepL

Describe the solution you'd like

e.g. DeeplService::translateRequest

 $glossaryId = '';
 // If the source language is set to Autodetect, no glossary can be detected.
 if ($sourceLanguage === 'auto') {
    $sourceLanguage = null;
} else {
            + // <<< emit event here
            + // dispatch new FetchGlossaryEvent($sourceLanguage, $targetLanguage);
            + $glossaryId = $fetchGlossaryEvent->getGlossaryId($sourceLanguage, $targetLanguage);
            + if ($glossaryId === '') {
                // @todo Make glossary findable by current site.
                $glossary = $this->glossaryRepository->getGlossaryBySourceAndTarget(
                    $sourceLanguage,
                    $targetLanguage,
                    DeeplBackendUtility::detectCurrentPage()
                );
                if ($glossary['glossary_id'] !== '') {
                    $glossaryId = $glossary['glossary_id'];
                }
            }
        }

Describe alternatives you've considered

I don't know if this fits conceptually. I think it might make the solution more flexible. Alternatively, there are other TYPO3 extensions I could take a look at.

@sypets sypets added the enhancement New feature or request label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant