Closed FluffyBunniesTasteTheBest closed 1 month ago
Thanks for bringing this to my attention.
I have just tested with the same keyfile entries, with the ":fx", and it ran without issue. I am not actually using DeepL though, so I kept the "oooooooo-oooo-oooo-oooo-oooooooooooo:fx". Can you confirm that you have the issue with the fake key as well, or is it only with a real key?
As for the "app_en" in the output, it is only meant to output the language code.
auto_translator v2.3.2
═════════════════════
Translated 0 entries from en to es-ES using deepL.
Translated 0 entries from en to de using deepL.
Translated 0 entries from en to fr using deepL.
Translated 0 entries from en to ja using deepL.
Translated 0 entries from en to tr using deepL.
Translated 0 entries from en to uk using deepL.
Finished translating to 6 languages.
This will be fixed shortly.
Output has been fixed in repo. Please let me know if you find out more about the keyfile issue as I have been unable to replicate.
@theLee3 Thanks for the quick response.
Using the fake key "deepL": "oooooooo-oooo-oooo-oooo-oooooooooooo:fx",
does not throw the error, but leads to an output similar to yours. Unfortunately it refuses to translate any of the messages... ;-)
Maybe something's wrong with the DeepL API key - it's a key from the free plan? I've already tried generating a new key, but same behavior...
Thanks @FluffyBunniesTasteTheBest (great name & avatar btw). I will try with a real key when I get the chance later today and report back.
This seems to be related to the key's :
character.
Adding a second :
to the (real) key - "deepL": "oooooooo-oooo-oooo-oooo-oooooooooooo::fx"
also prevents the error, but also doesn't translate.
Does the key's :
need to be escaped?
Actually, I think that it has to do with the format (or an unexpected null value) in the response from DeepL. The reason it's only occurring with the correct key is bc that is the only time translations are returned.
The problem lies with the error handling from DeepL. I was able to reproduce the issue by using an unsupported language code. You may have a different error occurring, but the error info will now be provided in the console.
Please update your pubspec.yaml
file as follows:
auto_translator: # 2.3.2
git:
url: https://github.com/theLee3/flutter_auto_translator
Then run dart pub get
to grab the latest changes. Afterward, you should be able to track down the issue. Please let me know what you find.
Awesome! It's working with the github link:
Building package executable...
Built auto_translator:auto_translator.
auto_translator v2.3.2
═════════════════════
hereslating from en to es using deepL ⠦
hereslating from en to es using deepL ⠹
hereslating from en to es using deepL ⠏
hereslating from en to es using deepL ⠴
hereslating from en to es using deepL ⠼
hereslating from en to es using deepL ⠙
Translated 538 entries from en to es using deepL.
hereslating from en to fr using deepL ⠦
hereslating from en to fr using deepL ⠸
hereslating from en to fr using deepL ⠋
hereslating from en to fr using deepL ⠇
hereslating from en to fr using deepL ⠦
hereslating from en to fr using deepL ⠸
Translated 538 entries from en to fr using deepL.
Finished translating to 2 languages.
The French translation contains plenty of unescaped apostrophes, but beside that, it's looking pretty good.
Just to verify, I've reverted pubspec.yaml
back to auto_translator: ^2.3.2
and the issue came back.
Again, thank you very much.
Great! Version 2.3.3 has been published to pub.dev.
Thank you for your help @FluffyBunniesTasteTheBest.
Awesome! Thank you!
Thank you very much for providing flutter_auto_translator.
After setting it up, running
dart run auto_translator
prints the following error:Configuration:
The configuration in
l10n.yaml
lools like this:The keyfile at
data/keys/auto_translator_keys.json
contains:Some more details:
When removing the trailing
:fx
from DeepL API key, the error message disappears, anddart run auto_translator
instead prints:So it looks like as if there's an issue with the
:
in the key. But what's also interesting is that... from app_en to ...
should actually read... from awesome_app_en to ...
.Do you have any ideas how to fix or workaround this?