Closed zihu12 closed 2 weeks ago
Merged, thank you!
This is a great idea.
I decided to let a list of LibreTranslate instances do the translation, like before, and not only one instance. The list can be reordered, instances can be added and removed from the list. Each instance can have it's own API key.
Having read the commit(https://github.com/j-fbriere/squawker/commit/f69516b722bb97650b7273a8aaed0cbe37ec2127) suggested that this is already implemented ;)
BTW there's something that comes to my mind:
/languages
(check if lang supported?) and /translate
(for translation) and libretranslate.de
was down again :(
2.With root access to my device, I did some research to FlutterSharedPreferences.xml
for prefs change or so on. In this process I found those:
<string name="flutter.content1718674994translation.ja.en.1782438806043656588">{"translatedText":["Bang!","\n"," \n"]}</string>
<string name="flutter.type1718674994translation.ja.en.1782438806043656588">String</string>
<string name="flutter.translation.ja.en.1782438806043656588">{"content":"content1718674994translation.ja.en.1782438806043656588","type":"type1718674994translation.ja.en.1782438806043656588"}</string>
<string name="flutter.content1718674992translation.supported_languages"></string> <!-- Redacted to save space -->
<string name="flutter.type1718674986translation.supported_languages">String</string>
I guess those are responses from the translation instance.
The problem is that they seems not automatically cleared (sorry if I wrong as I suspect this because after a sed /translation/d
it reduced from 700+kb to 7+kb)
I don't know if it's intentional but if not, maybe a bug?
Or maybe I should say them in another issue?
I just did the following test:
So everything works fine for me.
I'm not sure I understand what is your issue.
Could you please describe your issue in detail. Could you please provide the precise steps to reproduce your issue.
It will help me debug it. Thank you.
I just did the following test:
- I opened the Squawker application
- I opened the Translators list window
- I added the new host translate.lotigara.ru and saved
- I deleted the 3 default hosts by swap/delete
- I saved the list with only the new host in it
- I closed the Squawker application
- I reopened the Squawker application
- I opened the Translators list: it was still only with the new host
- I translated a tweet with success
So everything works fine for me.
I'm not sure I understand what is your issue.
Could you please describe your issue in detail. Could you please provide the precise steps to reproduce your issue.
It will help me debug it. Thank you.
You need a traffic inspector(pcapdroid will work) to reproduce this.
I will try to make a screeb record to illustrate this problem.
github complains that the video is too big, hope the description is enough :(
or you may just remove all the entries and the app should complain on attempt to translate ;)
I just did the following test:
- I opened the Squawker application
- I opened the Translators list window
- I added the new host translate.lotigara.ru and saved
- I deleted the 3 default hosts by swap/delete
- I saved the list with only the new host in it
- I closed the Squawker application
- I reopened the Squawker application
- I opened the Translators list: it was still only with the new host
- I translated a tweet with success
So everything works fine for me. I'm not sure I understand what is your issue. Could you please describe your issue in detail. Could you please provide the precise steps to reproduce your issue. It will help me debug it. Thank you.
You need a traffic inspector(pcapdroid will work) to reproduce this.
- in the app set translators as you said.
- stop the app then enable the inspector
- open the app, then try to translate something immedicately(the translator window will show correctly).
- See where the inspector says the traffic goes
~I will try to make a screeb record to illustrate this problem.~ github complains that the video is too big, hope the description is enough :(
or you may just remove all the entries and the app should complain on attempt to translate ;)
Hope these info enough to reproduce, or ask me to record and use zip to send(didn't realize this method until make that issue ;) )
Like I said, there is no issue for me.
I described earlier in detail the test I did with success.
If I cannot reproduce an issue, I cannot find the bug to fix it.
You're talking about using an inspector to analyze "something", but it's not clear what it is that I have to analyze and more importantly, what is the issue to begin with.
Maybe you should create a new issue in which you describe what is the problem. In your description please specify the steps in Squawker to reproduce the issue. No need to write about the tools used to try to resolve the issue for now, especially since I don't understand what the problem is.
Thank you.
Like I said, there is no issue for me.
I described earlier in detail the test I did with success.
If I cannot reproduce an issue, I cannot find the bug to fix it.
You're talking about using an inspector to analyze "something", but it's not clear what it is that I have to analyze and more importantly, what is the issue to begin with.
Maybe you should create a new issue in which you describe what is the problem. In your description please specify the steps in Squawker to reproduce the issue. No need to write about the tools used to try to resolve the issue for now, especially since I don't understand what the problem is.
Thank you.
Sorry for the inaccurate response :( An issue for this problem is created at #324 with a screenshot and a screen recording(and more detailed step)
Hope no offence, when I say we need inspectors I mean that's required to reveal the problem, since the embedded instances along with the retry mechanism will let it work behind the scene, and only with those is most likely to see which instance is actually being used.
Or if you mean that "solution", deleted and apologize for being too hurry
Currently the translation API endpoints are predefined/hardcoded as follows: https://github.com/j-fbriere/squawker/blob/b0f95723086f21fda805c8b8fbe0f443f9547125/lib/utils/translation.dart#L37 This will work most of the time, but sometimes not, especially for users in special network condition (also while testing for this PR
libretranslate.de
had undergone 502/Connection Refused
sometimes :(What this PR does:
translate.fedilab.app
)Don't know why so many whitespace-related changed inlib/settings/_general.dart
through not shown in VS Code. :(editor.formatOnSave
in.vscode/settings.json
filled my diff with whitespace changes :(