Giter Club home page Giter Club logo

wv_deepltranslate's Introduction

Latest Stable Version License TYPO3 11.5 TYPO3 12.4 Total Downloads Monthly Downloads

TYPO3 extension wv_deepltranslate

This extension provides automated translation of pages, content and records in TYPO3 for languages supported by DeepL.

Features

  • Translate content elements via TYPO3 built-in translation wizard
  • Single drop down translation parallel to regular page translation
    • Translate your page with all fields you want
  • One-Click translation of single records
  • Glossary support
    • Manage your own glossaries in TYPO3
    • Synchronise glossaries to DeepL API
    • Translate content using your glossaries

Early-Access-Programm

Early access partners of DeepL Translate will benefit from exclusive access to all add-ons, developer preview versions, access to private GitHub repositories, priority support, logo placement and a backlink on the official website. You will also get access to the DeepL Translate version 5.0 announced for TYPO3 v13.

The following add-ons are currently available as part of the Early Access Program:

  • DeepL Translate Assets: Translation of file meta data with DeepL
  • DeepL Translate Auto-Renew: Automatic creation of pages and content elements in translations, renewal of translations when the original language changes
  • DeepL Translate Bulk: Bulk translation of pages and content based on the page tree
  • Enable Translated Content: Activation of all translated content elements with one click

Find out more: https://www.web-vision.de/en/deepl.html

Installation

Install with your favour:

  • TER
  • Extension Manager
  • composer

We prefer composer installation:

composer req web-vision/wv_deepltranslate
URL
Repository: https://github.com/web-vision/wv_deepltranslate
Read online: https://docs.typo3.org/p/web-vision/wv_deepltranslate/main/en-us/
TER: https://extensions.typo3.org/extension/wv_deepltranslate/

Sponsors

We appreciate very much the sponsorships of the developments and features in the DeepL Translate Extension for TYPO3.

DeepL Glossary feature sponsored by

DeepL "Add automatic translation flag and hint" sponsored by

wv_deepltranslate's People

Contributors

andreaskienast avatar artus70 avatar ayacoo avatar baschny avatar bigahuna avatar borishinzer avatar calien666 avatar coding46 avatar dot3media avatar erhaweb avatar jwiednic avatar kitzberger avatar koehnlein avatar limeuwe avatar linawolf avatar mabahe avatar naircoder avatar narkniro avatar peterkraume avatar philip-hartmann avatar rickymathew avatar rickymathewkweb avatar riiiad avatar sbuerk avatar spoonerweb avatar sypets avatar szchimp avatar vishnu-web-vision avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

wv_deepltranslate's Issues

Type Error in GoogleTranslateService

In the GoogleTranslateService in Line 72 the return type is string. This is wrong an throws an error (Return value must be of type string, array returned).
If the return type is set to array or mixed (the return type of json_decode) it works fine.

Texts to select translate modes are not localized

The backend user only sees texts for selecting the translate mode in English, even if different language is selected. (For the description, a localized string is used though, just not for the button)

image

The texts are directly written as strings in Resources/Public/JavaScript/Localization.js and not localized.

Unfortunately, this is the same thing in the core: https://forge.typo3.org/issues/94277

I am not sure, but I think you can use localized strings in the TYPO3 JavaScript API.

Translation process is not completed

TYPO 10.4.31, wv_deepltranslate 2.2.1

When translating content elements (e.g. textmedia) on a page, the last step in the processing progress ("Processing") is not completed. I have to reload the backend and then see the hidden translated content elements.

When selecting several content elements on a page only one content element is translated.

When translating extensions (e.g. news, events2), the translation process is completed correctly and the extension is opened so that I can make any necessary corrections directly.

Make copy modes working

The translation modes should work with copies, too. Sure, first automatic translation is done 1:1, but it should be possible to add custom elements to translated pages, too.

In my opinion this missing is a major circumstance and it should have been mentioned in the README.md

Support for content elements with flux?

Your extension works great on TYPO3 v11 with standard content elements, but it seems not to be able to translate content inside flux content elements (https://extensions.typo3.org/extension/flux).

Database-wise this extension adds a field "pi_flexform" which contains the content in an XML-format style:

image

Is there any chance that content like that will be translateable?

503 - urlencode() expects parameter 1 to be string, null given

Deepl 2.2. with glossar function
TYPO3 11.4.14

For example, if I want to translate a news item, I get the error:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: urlencode() expects parameter 1 to be string, null given | TypeError thrown in file /var/www/vhosts/xxxx.my-provider.de/httpdocs/typo3cms/muster/typo3conf/ext/wv_deepltranslate/Classes/Service/DeeplService.php in line 92. Requested URL: https://www.xxxx.my-provider.de/typo3/record/commit?token=--AnonymizedToken--&redirect=%2Ftypo3%2Frecord%2Fedit%3Ftoken%3D--AnonymizedToken--%26justLocalized%3Dtx_news_domain_model_news%253A263%253A1%26returnUrl%3D%252Ftypo3%252Fmodule%252Fweb%252Flist%253Ftoken%253D121ee25112c632739d925cfc0e69eabb633d4a3a%2526id%253D889%2526table%253Dtx_news_domain_model_news%2526pointer%253D1&cmd%5Btx_news_domain_model_news%5D%5B263%5D%5Blocalize%5D=1&cmd[localization][custom][mode]=deepl

and a translation does not take place.
The same applies to other extensions (e.g. events2).

The glossary function works without errors and standard texts are translated.

Client error: `POST https://api-free.deepl.com` resulted in a `403 Forbidden`

TYPO3 10.4.27
wv_deepltranslate - newest version form github

I set up a DeepL API Free Account with Deepl and received an authentication key for the DeepL API.
I entered the authentication key in the extension settings (settings.apiKey (string) and as host 'https://api-free.deepl.com` (settings.apiUrl (string)).
If I now want to translate a content element with Deepl, I get the error message:

Client error: `POST https://api-free.deepl.com` resulted in a `403 Forbidden` response:
403 Forbidden

I have already renewed the authentication key without success.

Add extension-key to composer.json

On every composer command with installed extension there comes this error:

The TYPO3 extension package "web-vision/wv_deepltranslate", does not define an extension key in its composer.json. Please report this to the author of this package. Specifying the extension key will be mandatory in future versions of TYPO3 (see: https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ExtensionArchitecture/ComposerJson/Index.html#extra)

This is the mentioned report. 😉

Misconfiguration 'tx_deepl_settings' TCA (ctrl/label)

The 'label' in the 'ctrl' section for the table 'tx_deepl_settings' is configured with Deepl settings, which is not a field name in this table.
In the documentation the 'label' property is mentioned as a required string which must be a field name: https://docs.typo3.org/m/typo3/reference-tca/main/en-us/Ctrl/Properties/Label.html#label

If the label was configured as a random text the dbint module crashes with the following error:

Oops, an error occurred!
An exception occurred while executing 'SELECT `uid`, `pid`, `Deepl settings` FROM `tx_deepl_settings` WHERE `pid` NOT IN (...)

Please set label to uid, which is a field in the table. This doesn't impact the usability, because the table is hidden in the backend at all.

Thanks :-)

extend form fields for terms

Glossary: Often longer terms have to be translated, which are then no longer displayed completely in the BE:

Example: Studien-und Prüfungsordnung für das Lehramt der Musik an Grund-, Mittel-und Realschulen sowie Gymnasien der Hochschule für Musik XXXXX (LASPO)

TYPO3 11.5.x

Hello,
is there a plan to make it compatible with latest TYPO3 11.5 version?
Thanks!
Martin

Feature request: Add support for DeepL glossary

The DeepL glossary is also supported within the API since August 24, 2021.

The glossary functions allow you to create, inspect and delete glossaries. It is available at https://api.deepl.com/v2/glossaries. Glossaries created with the glossary function can be used in translate requests by specifying the glossary_id parameter.

This may improve the output because a more domain specific set of terms is used. For example, for the university we use a term library for English / German which is regularly updated.


Glossary: handling of entries for manual and automatic translation (e.g. several target terms)

From my point of view there are 2 applications for a glossary or rather a translation matrix.

  1. Glossary for human readers
  2. Glossary for DeepL automatic translation

What we currently have (https://uol.de/glossar) was originally intended for "humans".

We do of course want to reuse this or parts of it for DeepL, but what is not supported currently (neither by DeepL or the extension) are several target terms.


For example:
DE (source):Abschlussarbeit (Studium)
EN (target):

  • thesis
  • final project
  • final paper

We sometimes have several possible terms where it would be ideal if DeepL could pick the most appropriate one. This is not possible (as it is not supported by DeepL AFAIK). So we will probably create an glossary for automatic translation where we either remove those entries or stick to one target term.

In the long run, it seems to me it would be a good solution if the glossary entries in wv_deepltranslate were flexible - especially if this is also to be displayed in the FE. For the FE (for human readers), we might want to keep those entries (and not have to maintain a second almost identical list elsewhere).

For example, you could have checkboxes, such as

  • use for automatic translation
  • show in FE

(both selected by default).

This will probably make everything a little more complicated than was originally intended - but here it is important that maybe not everything is implemented but is considered in the concept and can be easily extended.

Buttons for translation with DeepL are displayed even if target language is not supported

Reproduce

  1. Add language "Turkish"
  2. Create page with content and translation page to "Turkish"
  3. Click Translate, choose Translate (deepl)
  4. an error message appears:

Client error: POST https://api.deepl.com/v2/translate` resulted in a 400 Bad Request response: {"message":"Value for 'target_lang' not supported."}`

I would expect the DeepL translate button to not be displayed if the target language is not supported by DeepL.

unexpected 'fn' (T_STRING), expecting :: (T_PAAMAYIM_NEKUDOTAYIM)

i installed the extension and tried to open a page with list. The error message shown is this:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: syntax error, unexpected 'fn' (T_STRING), expecting :: (T_PAAMAYIM_NEKUDOTAYIM) | ParseError thrown in file /usr/www/users/devnax/dev.mysite.com/typo3/releases/95/web/typo3conf/ext/wv_deepltranslate/Classes/Override/DatabaseRecordList.php in line 42. Requested URL: https://dev.mysite.com/typo3/index.php?route=%%2Fweb%%2Flist%%2F&token=--AnonymizedToken--&id=474&

Can't tell why this is happening and how to fix it, hope someone can help me.

Javascript broken in frontend

If user is logged in in frontend, following javascript is loaded and breaks jquery from default page javascript:

`

<script type="text/javascript"> /**/ </script> <script src="typo3/sysext/core/Resources/Public/JavaScript/Contrib/require.js?1639047864" type="text/javascript"></script> <script src="typo3/sysext/core/Resources/Public/JavaScript/requirejs-loader.js?1639047796" type="text/javascript"></script> <script type="text/javascript"> /**/ </script>`

How can I disable loading js in frontend?

Content elements inside already translated b13/container containers are not shown in Localizations Modal Wizard

Hi,

having a already translated container and create a new CE in the default-language container

image

now try to translate ends in an 400 server error (and a frozen modal) during localization wizard (because the CE inside the container "is not found":

image
image

this is due the Xclass of EXT:container is overriden in EXT:wv_deepltranslate
correct behaviour (like in the xclass of the EXT:container)
image

i will provide a pr

s. also:
#44
b13/container#188

Tested with TYPO3 10.4.26, EXT:container 1.5, EXT:wv_deepltranslate 2.0.1

Bug with API endpoint?

We installed the latest TER version of this extension into a 10.4.21 TYPO3 installation and tried to translate a standard text content element. We inserted a valid Deepl API Key (according to client) into the extension configuration. When translating in the page module in the last step we get an error message:
Client error: POST https://api.deepl.com/v2/translate resulted in a 403 Forbidden response: {"message":"Wrong endpoint. Use https://api-free.deepl.com"}
Does this clearly say the API key is invalid? Or was there maybe a change in the Deepl API infrastructure?

Our web-site is not httpauth protected at the moment as we thought this could habe been the reason for this error, but it was not. When changing the API endpoint to https://api-free.deepl.com/v2/translate it works.

small typo

deepl 2.2.1

please 'Beschreibung' not ' Beschriebung'.

No search possible

deepl 2.2.1
TYPO3 10.4.31

All glossary entries are in a folder. When searching for a term with the magnifying glass in the header, I never get hits.

Easier way to delete glossary items

We are testing the glossary functionality in our project (Uni-Osnabrück). Works good, but I found no easy way - as an editor - of deleting a glossary entry.

We allow editors to create tx_wvdeepltranslate_domain_model_glossaries which works great when creating new glossary items. This auto-generates DB entries tx_wvdeepltranslate_domain_model_glossariessync which are just a json representation of the "translation item" (for the API, I suppose) and are not really manageble manually, since they have an UUID as a title.

I want, as an editor, to be able to delete a glossary term and its translation, by simply removing the tx_wvdeepltranslate_domain_model_glossaries entries - and have the API resolve which tx_wvdeepltranslate_domain_model_glossariessync entries to delete (or update) on their own.

Any chance of doing having that missing feature included in a future release?

Kind regards,
Ernesto

Translation process stuck

API key and URL are set, languages are configured in the extension settings. When translating a page with the 'Translate (deepl)' option, it's loading forever and no signs of my DeepL budget are used. The option 'Translate (Google)' is just reproducing the original text without translation. The other options are not working either for me. How can this be fixed?

Support for deepl formality option

Thank you for this great Extension.
My client asked me if i can set the option "formality" to "more". API-Doc

Unfortunately there are no settings for this, can you add this to the next version?

Missing or wrong PHP compatibility.

For example, since the last version 2.0.1, code like the following is used:

$possibleTranslations = array_map(static fn($siteLanguage) => $siteLanguage->getLanguageId(), $this->languagesAllowedForUser);

https://github.com/web-vision/wv_deepltranslate/blob/2.0.1/Classes/Override/DatabaseRecordList.php#L42

This is only compatible with PHP 7.4 and up.

Compatibility with PHP <=7.3 is no longer given. Please make the version compatible to PHP < 7.4 or adjust the requirements accordingly.

Translate DCE element

Hi,

Thank you so much for this awesome extension with the cool translating options.

Is this possible to make translation for the DCE (dynamic content element) elements?

Please share your thought on it asap.

Thanks again
Team Vbuilt Solution

Update to version 2.0.1

Hello,

after updating from version 2.0.0 to version 2.0.1 using Composer, I get the following error message:

Too few arguments to function WebVision\WvDeepltranslate\Override\DatabaseRecordList::makeLocalizationPanel(), 2 passed in XXX/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php on line 1342 and exactly 3 expected

Running Analyze Database Structure did nothing.

Best wishes
EPOCHE NAPOLEON

Too few arguments to function makeLocalizationPanel

On TYPO3 10.4.23 with wv_deepltranslate 2.0.1 on PHP 7.4 the following error occurs in the list module on any page:

Oops, an error occurred!
Too few arguments to function WebVision\WvDeepltranslate\Override\DatabaseRecordList::makeLocalizationPanel(), 2 passed in /typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php on line 1342 and exactly 3 expected

Typo3 CurlError

Hi.
I've downloaded your extension for Typo3 and when I try to translate a small media&test containing Hello World in the processing step it stops. When I refresh the page in my logs I see an error:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: cURL error 56: Recv failure: Connection reset by peer (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) | GuzzleHttp\Exception\RequestException thrown in file /home/user/Projects/test/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php in line 201.

The test environment is on a local machine with apache2. Curl enabled.

Best Regards.

Update for TYPO3 11 LTS

Are you planning on providing an update of your extension to be available soon for TYPO3 11 LTS?

wv_deepltranslate does not show translations.

Hello Community,

i installed the wv_deepltranslate extension on a Typo3 Version 10 Project.

I've already set the Deepl APi Key and the other configs.

But when i tried to translate a standard CE like Text with Picture it doesn't show the translation.

My Deepl character consumption is counting every translation.

Does somebody has any idea?

require.js in Frontend

TYPO3 v10.4.27 with EXT:wv_deepltranslate v2.0.1
require.js and requirejs-loader.js x and y are loaded in the frontend and cause errors there.

Special character ampersand "&" not decoded

Ampersands in headlines or texts (plain texts, no RTE) are not decoded and are stored as "&amp;" in database.

To reproduce:

  1. Create an CE with an ampersand character in headline.
  2. Translate CE via deepl extension
  3. View CE in frontend or in database

image

Obviously only ampersand character is affacted.

Creating a new glossary entry throws exception because it is assumed default language record with uid=0 exists in sys_language

Using branch: glossary-integration with TYPO3 v11

$defaultLanguage = $this->languageRepository->findByUid(0);

Exception:

Call to a member function getLanguageIsoCode() on null

in /var/www/t3dev.uni-oldenburg.de/htdocs/typo3conf/ext/wv_deepltranslate/Classes/Hooks/DataHandlerHook.php line 63
        $this->languageRepository = $objectManager->get(LanguageRepository::class);

        $systemLanguages = $this->languageRepository->findAll();
        $defaultLanguage = $this->languageRepository->findByUid(0);
        $defaultLangIso = $defaultLanguage->getLanguageIsoCode();

        if ($systemLanguages->count() > 0) {

In my current test installation (which is based on the TYPO3 base distribution with introduction package, there is no sys_language record 0. There is no language record for the default language. I am not sure if it is necessary for the default language.

select uid,title from sys_language ;
+-----+--------+
| uid | title  |
+-----+--------+
|   1 | Dansk  |
|   2 | German |
+-----+--------+

(You can setup a basic base distribution, see https://docs.typo3.org/m/typo3/tutorial-getting-started/main/en-us/Installation/Install.html#install)

composer create-project typo3/cms-base-distribution:^11 t3intro11
composer require typo3/cms-introduction:^4.4.1

So, not sure how to best handle this, but relying on the record with uid=0 exists in sys_language - may not always work.

Error when translating in list mode into a language not supported by Deepl

Hello!

I use wv_deepltranslate V.1.1.2 under Typo3 V.9.5. I get the following error when translating in list mode (e.g. for a news article) into a language not supported by Deepl (e.g. Czech, Russian or Turkish)

{"status":"false","message":"Client error: POST https:\/\/api.deepl.com\/v2\/translate resulted in a 400 Bad Request response:\n{"message":"Value for 'target_lang' not supported."}\n"}

Thanks for your response in advance!

[FEATURE] Hide buttons if api key isnt set (Deepl)

At the moment, the translation buttons are always displayed and when you click on them, you get a message that the settings have to be completed.

Of course, an editor can't do much with that at first. My suggestion: Only show the buttons if the API settings exist.

Undefined array key "mode"

Hi,

I found this extension and tried to use it the first time. I use TYPO3 11.5.12 with PHP 8.0 on ddev. After installing the extension by composer I added the API key from deepl (from Google I don't want to use). I included Typoscript, languages (DE/EN) are configured and working. The TCA stuff I skipped to test the extension first basically. When I want to translate a page ("create a new translation of this page") I'm getting the following error message only:

image

Line 82 means $customMode = $cmdmap['localization']['custom']['mode'];

I can't find anything neither in the docs nor in Typoscript to set something like a "mode". Maybe it's a bug.

Best,
Markus

Error with Typo3 v10

If I used this with typo3 in version 10.4.13 i became an error:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: Too few arguments to function TYPO3\CMS\Backend\Controller\Page\LocalizationController::getPageColumns(), 1 passed in /var/www/html/public/typo3conf/ext/wv_deepltranslate/Classes/Override/LocalizationController.php on line 188 and exactly 3 expected

This is the line:

return (new JsonResponse())->setPayload([
   'records' => $records,
   'columns' => $this->getPageColumns($pageId),
   ]);

If i edited it to this:

return (new JsonResponse())->setPayload([
   'records' => $records,
   'columns' => $this->getPageColumns($pageId, $records, []),
   ]);

it will work.
But it is not a good practice to work in the extension files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.