Skip to content
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

Long delay in translation #667

Open
meandrewdev opened this issue Mar 16, 2024 · 5 comments
Open

Long delay in translation #667

meandrewdev opened this issue Mar 16, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@meandrewdev
Copy link

meandrewdev commented Mar 16, 2024

Bug description
At some point, translation started to be delayed for about 5-10 seconds. And if I translate another text after that, it happens without delay. If you wait for some time and try to translate something again, it translates with a delay. I tried to run it from the console to see the log, but there are no messages. Tried through mitm proxy - it doesn't accept the certificate. Also tried reinstalling, this behavior appears in both crow-translate package and crow-translate-git in AUR. Also deleted the configuration file, no help. Everything was fine for a long time, but it started after a kernel or system update, I don't remember

Steps to reproduce

  1. Install crow-translate from AUR
  2. Try to translate anything
  3. Wait ~5 minutes
  4. Try to translate anything

Expected behavior
No delay in translation

Environment

  • OS: Manjaro Linux x86_64
  • Kernel: 6.7.7-1-MANJARO
  • Shell: bash 5.2.26
  • DE: Plasma 5.27.11
  • WM: KWin
  • CPU: Intel i7-8750H (12) @ 4.100GHz
  • GPU: NVIDIA GeForce GTX 1050 Ti Mobile
  • Crow Translate version: 2.11.1

Additional context
When running from the console, I got this message:
qt.svg: Cannot open file ':/icons/flags/sa.svg', because: No such file or directory

crow-translate.conf

[General]
MainWindowOrientation=0
StartMinimized=true
TrayIconVisible=true
WindowMode=0

[Buttons]
CheckedSource=-2
CheckedTranslation=-2
Source=ru, uk, en
Translation=uk, ru, en

[Connection]
ProxyAuthEnabled=false
ProxyHost=
ProxyPassword=
ProxyPort=8080
ProxyType=0
ProxyUsername=

[Interface]
CustomIconPath=crow-translate-tray
Font=@Variant(\0\0\0@\0\0\0\x12\0N\0o\0t\0o\0 \0S\0\x61\0n\0s@$\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
MainWindowLanguageFormat=0
PopupHeight=300
PopupLanguageFormat=1
PopupOpacity=0.8
PopupWidth=350
PopupWindowTimeout=0
TranslationNotificationTimeout=3
TrayIconName=0

[MainWindow]
AutoTranslate=false
CurrentEngine=0
WindowGeometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\b\x92\0\0\x2\x1\0\0\fj\0\0\x3\x11\0\0\b\x92\0\0\x2\x1\0\0\fj\0\0\x3\x11\0\0\0\0\0\0\0\0\a\x80\0\0\b\x92\0\0\x2\x1\0\0\fj\0\0\x3\x11)

[OCR]
ApplyLightMask=true
CaptureDelay=1000
ConfirmOnRelease=false
ConvertLineBreaks=true
Languages=@ByteArray(eng+osd+rus)
LanguagesPath=@ByteArray()
RegionRememberType=0
ShowMagnifier=false

[Shortcuts]
CloseWindow=Ctrl+Q
CopyTranslatedSelection=
CopyTranslation=Ctrl+Shift+C
DelayedRecognizeScreenAreaShortcut=
DelayedTranslateScreenAreaShortcut=
GlobalShortcutsEnabled=true
PlayPauseSpeakingSelection=Ctrl+Alt+G
RecognizeScreenAreaShortcut=
ShowMainWindow=Ctrl+T
SpeakSelection=Ctrl+Alt+S
SpeakSource=Ctrl+S
SpeakTranslatedSelection=Ctrl+Alt+F
SpeakTranslation=Ctrl+Shift+S
StopSelection=Ctrl+Alt+G
Swap=Ctrl+R
Translate=Ctrl+Return
TranslateScreenAreaShortcut=Ctrl+Alt+Q
TranslateSelection=Ctrl+Q

[TTS]
GoogleRegions=@Variant(\0\0\0\b\0\0\0\b\0\0\0\n\0T\0\x61\0m\0i\0l\0\0\0\x2\0\0\0\0\0\0\0\xe\0S\0p\0\x61\0n\0i\0s\0h\0\0\0\x2\0\0\0\0\0\0\0\x14\0P\0o\0r\0t\0u\0g\0u\0\x65\0s\0\x65\0\0\0\x2\0\0\0\0\0\0\0\f\0G\0\x65\0r\0m\0\x61\0n\0\0\0\x2\0\0\0\0\0\0\0\f\0\x46\0r\0\x65\0n\0\x63\0h\0\0\0\x2\0\0\0\0\0\0\0\xe\0\x45\0n\0g\0l\0i\0s\0h\0\0\0\x2\0\0\0\0\0\0\0(\0\x43\0h\0i\0n\0\x65\0s\0\x65\0 \0(\0S\0i\0m\0p\0l\0i\0\x66\0i\0\x65\0\x64\0)\0\0\0\x2\0\0\0\0\0\0\0\xe\0\x42\0\x65\0n\0g\0\x61\0l\0i\0\0\0\x2\0\0\0\0)
YandexEmotion=0
YandexVoice=0

[Translation]
ExamplesEnabled=true
ForceSourceAutodetect=true
ForceTranslationAutodetect=true
LibreTranslateApiKey=@ByteArray()
LibreTranslateUrl=https://translate.argosopentech.com
LingvaUrl=https://lingva.garudalinux.org
PrimaryLanguage=0
SecondaryLanguage=22
SimplifySource=false
SourceTranscriptionEnabled=true
SourceTranslitEnabled=false
TranslationOptionsEnabled=true
TranslationTranslitEnabled=false
@meandrewdev meandrewdev added the bug Something isn't working label Mar 16, 2024
@Shatur
Copy link
Member

Shatur commented Mar 16, 2024

Interesting, I also use Arch, but I don't have this problem.

@meandrewdev
Copy link
Author

Interesting, I also use Arch, but I don't have this problem.

Now it got even more interesting :)
I did decide to look at the requests and bypassed the certificate validation. And the http proxy works fine! As soon as I set "Don't use a proxy", the problem comes back. It's even hard to guess what it could be

@meandrewdev
Copy link
Author

Is there any way to run in debug mode and see the logs? I am not very good at C++, can you tell me how to do it? To at least understand what the reason is, maybe it's something in my system. Because after reboot even proxy didn't help for some reason, first translations were delayed. I can see the requests it makes, and the problem is not network - the request execution time is about 60ms, so it's something else.

@Shatur
Copy link
Member

Shatur commented Mar 19, 2024

Is there any way to run in debug mode and see the logs?

We don't have a logging system, unfortunately...

To at least understand what the reason is, maybe it's something in my system.

I suspect that it could be the case. If you see the slowdowns, it could be caused by Qt library. The app just wait for the response from the Qt API.
What you could try is to load up a live CD with a different distro. Like EndeavourOS (it's more similar to Arch then Manjaro) and see if the issue can be reproduced.

@VolkMilit
Copy link
Contributor

VolkMilit commented Mar 20, 2024

I'm also using Arch BTW and can't replicate this problem.

What engine do you use? Lingva and Libre delays depends on instance used. Google translate almost instantly. Yandex do have delays, but not 5 seconds. Bing is, well, being Bing and do have delays even in their web interface.

The other thing you can do, to cut possibility this is Qt bug, using curl to do same requests as Crow do, like:

curl "https://translate.googleapis.com/translate_a/single?client=gtx&ie=UTF-8&oe=UTF-8&dt=bd&dt=ex&dt=ld&dt=md&dt=rw&dt=rm&dt=ss&dt=t&dt=at&dt=qc&sl=en&tl=en&hl=en&q=test"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants