-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Fix mozhi engine language code #459
base: master
Are you sure you want to change the base?
Conversation
I couldn't reproduce that Mozhi uses 3 char language codes, every Mozhi engine I tested returned 2 char language codes. Have you used a specific Mozhi engine to reproduce that? |
ok yeah sorry i tested it in a bad way, it happens only with reverso through mozhi can the code be modified to check against only reverso maybe? |
Theoretically yes, but I don't think it makes much sense. Reverso probably expects 3 character language codes, so it wouldn't work if we send 2 characters instead. Generally, the app should automatically refresh the list of available languages when you change the Mozhi engine to Reverso, so you should never run into the issue this PR aims to address, except if there's an API error at Mozhi when fetching the languages. Or do you have found any other ways where this issue happens too? |
For the text to speech at Mozhi however, we should certainly use your patch to only use the first two chars, since the text to speech from Mozhi always uses Google as engine, and thus needs two character language codes. |
the thing is reverso expect 3 but mozhi thorugh reverso 2 also i'm changing the way mozhi handles languages not reverso, it should still work with only reverso as main engine, but correct me if i'm wrong here |
Oh okay, I though Mozhi through Reverso expects 3 chars. |
Co-authored-by: Bnyro <bnyro@tutanota.com>
Hi!
currently the Mozhi engine tries to query the api with the language code of 3 chars long while it should be of 2.
I implemented this so that if it's 3 chars long it removes the last without breaking the languages that have 2 chars as code.
Tested and working on my end