Comments (10)
Outputs
string(39) "59ecab18-xxxx-431e-1bcc-9999c7a6e959:fx"
(I have changed the key a bit and changed it meanwhile - but it is my authkey)
I am running on Kirby 4 alpha-5. Also I have two other plugins active (an SEO one and one for Matomo) but I cannot see how this could impact anything?
When replacing the version of your code, I deleted the whole directory and reuploaded the whole thing.
Oh I also deleted the media directory.
When I don't die(), I get a strange redirect which you obviously do not get.
What Kirby version are you running?
Edit: Interesting. I tried to create a new DeepL authkey and the portal says "Permission denied". So maybe it really is just my key. Let me check with DeepL support.
from kirby-machine-translation.
It works now @tobiasfabian, lots of thanks for your great support! It seems like my account was half-registered half-not-registered, After DeepL support fixed something, I had to re-register, re-generate a new AuthKey and now it works. I will test over the weekend and provide feedback if you like. Danke nochmal!
from kirby-machine-translation.
For testing purposes, I hardcoded the API key now into the index.php of the plugin. When pressing the button, I now receive a different error message:
Any way how I can help debug this @tobiasfabian ?
Thanks
Andreas
from kirby-machine-translation.
Hi @andreasba,
thanks for testing the plugin. There was indeed a problem with the handling of the options. I fixed it with 160bf70.
You should now be able to set the DeepL key as described in the Readme. I’m not sure about the second error you mentioned. If it still exists, could you please check the Web Inspector console for further details on the error.
from kirby-machine-translation.
Thanks for your quick response @tobiasfabian :)
Now, when pressing the translation button, I get a Fatal DeepL API error:
I am not a pro in debugging, but this is what the Web Inspector spits out:
Is that useful?
from kirby-machine-translation.
Thanks for your reply and thank you for being an early adopter. It helps a lot.
It’s a PHP error which is logged into the JavaScript console. So your second screenshot is the relevant one. It says, that the problem is on line 253
of the file /site/plugins/machine-translation/lib/Translate.php
.
kirby-machine-translation/lib/Translate.php
Lines 250 to 254 in 160bf70
The response of the DeepL API is not as excepted. Therefore I have improved the error handling of the DeepL API response. Could you please download the latest version and test again?
from kirby-machine-translation.
Thanks for your quick reaction @tobiasfabian ! Your plugin could be extremely useful so it is my pleasure to help anyway I can :) Now I receive the following error code:
(and I am quite sure I have the config.php edited in the right way)
If I hardcode the API key again into index.php of the plugin I get the same error. The same when I try via env.php file:
Edit: on the DeepL website, it states to make sure to use the right domain: api-free.deepl.com (I have a free API key, not a paid one). Could that be the issue?
from kirby-machine-translation.
There is something wrong with your Auth Key. I’m using the free API myself. This should not be the issue.
To debug your issue, could you please check the following. Add a var_dump($authKey)
between line 239 and 241 of lib/Translate.php
. When you click on “Translate Page” the output should be something like this, where you can check if your Auth Key is correct (your Auth Key is shown after string(39)
). Your Auth Key should be ending with :fx
(because you are using the free API).
kirby-machine-translation/lib/Translate.php
Lines 239 to 241 in d131a65
from kirby-machine-translation.
To debug, you can use a curl command with your Auth Key.
curl -X POST 'https://api-free.deepl.com/v2/translate' \
--header 'Authorization: DeepL-Auth-Key [yourAuthKey]' \
--header 'Content-Type: application/json' \
--data '{
"text": [
"Hello, world!"
],
"target_lang": "DE"
}'
https://www.deepl.com/de/docs-api/translate-text/translate-text/
from kirby-machine-translation.
Good idea @tobiasfabian - I get a 403 Forbidden error. Lets wait what DeepL support says.
from kirby-machine-translation.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kirby-machine-translation.