-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow custom LibreTranslate instance #319
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks fine, can be merged
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. |
Having read the commit(f69516b) suggested that this is already implemented ;) BTW there's something that comes to my mind:
2.With root access to my device, I did some research to <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. 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. It will help me debug it. |
You need a traffic inspector(pcapdroid will work) to reproduce this.
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. Thank you. |
Sorry for the inaccurate response :( 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:
squawker/lib/utils/translation.dart
Line 37 in b0f9572
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 :(