werkraum / deepl-translate-slim
Translate all your pages on demand, without additional configuration. You do not need to set up more than one language in TYPO3. Enable Translation targets in your site configuration and display a language menu with our Menu Integration and you are ready to go.
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:typo3-cms-extension
Requires
- php: ^8.1
- ext-curl: *
- ext-dom: *
- typo3/cms-core: ^12.4
README
Translate all your pages on demand, without additional configuration. You do not need to set up more than one language in TYPO3. Enable Translation targets in your site configuration and display a language menu with our Menu Integration and you are ready to go.
- Pages are only translated on demand
- a middleware processes the response from TYPO3 and has it translated by DeepL
- the translation process can be customized to your needs Custom Translation Processing
- all translation targets are validated
- e.g. if you disabled
DK
it is not possible to bypass this value
- e.g. if you disabled
- search bots are excluded by default (otherwise they could use up you api translation volume)
- all fetched translations are stored in a separate cache (to further protect you api volume)
Further Infos
https://werkraum.net/typo3-deepl-integration (german)
Installation
composer require werkraum/deepl-translate-slim
Extension Setup
You have to provide an authenticationKey
. Make sure to set the API Type to pro if you have a pro account.
Global Configuration Values
Site Configuration Values
Menu Integration
The extension has a custom \Werkraum\DeeplTranslate\DataProcessing\DeepLMenuProcessor
to provide the enabled DeepL translation targets. It provides the same values as the \TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor
dataProcessing {
10 = Werkraum\DeeplTranslate\DataProcessing\DeepLMenuProcessor
10 {
as = menu
}
}
<html data-namespace-typo3-fluid="true" xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers" > <nav class="nav languagenav text-uppercase notranslate"> <f:for each="{menu}" as="item" iteration="iter"> <a class="nav-link" href="{item.link}" hreflang="{item.hreflang}" title="{item.title}"> <span>{item.title}</span> </a> </f:for> </nav> </html>
Caching
The extension has its own cache to ensure that translations are retained in the system even if the content of the pages changes. The service is not free of charge and should be used sparingly. Nevertheless, this cache can be checked and emptied:
You can enable cacheClear
in the extension configuration to always flush the translations on page or page content change. By default it is disabled.
A dedicated view in the InfoModule provides a detailed overview of all cached pages.
Custom Translation Processing
You can customize and extend the translation process by implementing a custom DocumentProcessor with the Interface \Werkraum\DeeplTranslate\DocumentProcessor\DocumentProcessorInterface
.
Look into ReplaceLinksProcessor.php to see it in action.