Download the PHP package werkraum/deepl-translate-slim without Composer
On this page you can find all versions of the php package werkraum/deepl-translate-slim. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download werkraum/deepl-translate-slim
More information about werkraum/deepl-translate-slim
Files in werkraum/deepl-translate-slim
Package deepl-translate-slim
Short Description 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.
License GPL-2.0-or-later
Homepage https://werkraum.net/typo3-deepl-integration
Informations about the package deepl-translate-slim
What does it do?
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
Key | Description |
---|---|
authenticationKey | The authentication Key for the DeepL Api Deepl API Key |
host | The API Type. Free and Pro have different Endpoints. Free and Pro |
formality | See Deepl API Reference |
ignoreTags | See Deepl API Reference |
splitSentences | See Deepl API Reference |
preserveFormatting | See Deepl API Reference |
nonSplittingTags | See Deepl API Reference |
outlineDetection | See Deepl API Reference |
splittingTags | See Deepl API Reference |
clearCache | See Caching |
Site Configuration Values
Name | Key | Description |
---|---|---|
(default/fallback) Source Language | default_deepl_source_language | The source language DeepL will use to translate from. Can be disabled for each language. See languages. |
(default/fallback) Allowed targets | default_deepl_allowed_languages | Add all allowed languages as alternate links. (clear the page cache to make this change take effect!) |
Hreflang | deepl_hreflang | Only this languages will be offered for translation. Can be changed for each language. See languages. |
Exclude Elements | deepl_exclude_elements_by_selector | Exclude HTML elements from translation by CSS3 Selector (comma-separated!) |
Split content | deepl_split_content_by_selectors | DeepL has a content-length limit per translation request so we need to split our html into parts. Specify parts of your HTML by a comma-separated list of CSS3 selectors which can be translated separately. e.g. "#page-header,#page-content,#page-footer" |
Replace links | deepl_replace_links | Add the language param "deepl" to all links? |
Skip links | deepl_replace_links_attribute | Yes/No |
Translated by machine placeholder | deepl_translated_by_machine | You have the following placeholder: {source}, {target}, {originalLink} |
Target for the Translated by machine placeholder | deepl_translated_by_machine_target | Please specify an html element with an ID |
Translate the Translated by machine placeholder | deepl_translate_translated_by_machine | Yes/No |
Recaptcha Protection | deepl_recaptcha | Enable recaptcha verification to allow access to translated content. |
Recaptcha Verify Page | deepl_recaptcha_redirect_to_page | PAge to redirect the user to verify their access via recaptcha. The configured page has to display the recaptcha verify plugin. |
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
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.
SEO and Bots
To save DeepL resources and avoid spamming the translation service, we use the following rules:
- search bots are excluded by default (otherwise they could use up your api translation volume)
- all fetched translations are stored in a separate cache (to further protect your api volume)
You should exclude all Urls with deepl
from your robots.txt file. For example: