Reverso plugin - Official Support Thread

I don’t see a link to the code, maybe I could do a PR with those features if I can get access to the code?

My bad, I never published it, but I always meant to do it. leave me some more days and I’ll do it. If in a week I have not done it, please nudge me…
[ the reason I didn’t publish it yet, is that I’m more a mercurial fan rather that git, but there are no more public free mercurial spaces, anyhow I’ll publish it on github…]

Great thanks! If I can make it work it will make my card creation flow so much easier.

Consider this a nudge :grinning:

Great, thanks for the nudge! *:wink:
So the repo is: GitHub - sandroden/reverso-anki-addon: An addon to import from Reverso site
I don’t consider the story to be that important up to now. So I just imported the current repo.

As far as your issues:
the target deck is something that defy my comprehension. I tried hard, it seems to work in some circumstances (mostly for me) and fails in others. The API from anki are in my opinion quite cumbersome.

changing the format of the card is a nice feature, but I wonder if it’s the way to cope with “close”.

My typical workflow is that I

  • add a card from Reverso
  • I edit using some other dicts to get more examples
  • after a week I add a close from the examples

I would have liked to make this last step as easy as possible and maybe add a reminder if no close was ever added from this note but I have never found a really satisfying solution. I’m happy to see your suggestions.

Sandro
*:slight_smile:

Great thanks, I will give it a try but I’m new to add-on, python, and QT…so we’ll see :sweat_smile:

os: mac m1
Debug info:
Anki 2.1.56 (07fd88dd) Python 3.9.15 Qt 6.3.2 PyQt 6.3.1
Platform: macOS-13.2.1-arm64-arm-64bit
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-04-02 01:57:17
Add-ons possibly involved: ⁨Reverso importer⁩

Caught exception:
Traceback (most recent call last):
File “aqt.browser.table.table”, line 453, in _on_context_menu
File “_aqt.hooks”, line 1204, in call
File “anki.hooks”, line 34, in runHook
File “/Users/abderrahman/Library/Application Support/Anki2/addons21/2060267742/utils.py”, line 95, in setupMenu
menu_data = [x.data() for x in menu.children()]
File “/Users/abderrahman/Library/Application Support/Anki2/addons21/2060267742/utils.py”, line 95, in
menu_data = [x.data() for x in menu.children()]
AttributeError: ‘QMenu’ object has no attribute ‘data’

Does not work anymore in
Version ⁨23.10.1 (fac9e0ee)⁩
Python 3.9.15 Qt 6.6.0 PyQt 6.6.0
Which deeply saddens me

Btw. this is one of the reasons why I actually use Reverso. This add-on makes Reverso soo much more useful. Thank you for your work

Maybe try the Qt5 version of Anki 23.10 and higher.

For the author of the add-on, this page may be helpful: Porting tips for Anki 23.10

It might be as simple as changing some enums and importing from aqt.qt instead of PyQt5.Qt*

Thanks for letting me know about this issue.
I’ll work on it possibly next we. It’s definitely my intention to keep it working (but I’m still on an older version)
Thanks to @sprvlcn for the hint.
@MedBooster, I’m pleased you appreciate my plugin but you could contact me even w/o downvoting…

Sandro

Hello @sandro
My bad! It is a well-deserved thumbs up now! I just saw others reporting their issues there, but now I understand that it isn’t the right place to discuss bugs because of you not being able to reply there etc…

By the way, @sandro , maybe you would have any instructions on how to change the imported card format? Would that be possible? As of now I’ve had to manually convert all cards to appear in my custom format

Here’s my custom card format in case anyone’s interested (I have not yet made it for the reversed card-type which I have not found yet) :


Front template:


<p>
{{hint::context}}

        <div><div class="lang">
        {{srcLang}} → {{trgLang}}
        </div>

<hr>

Back template:

            {{edit:srcText}}
<br>
            <div class="context">
   
                {{edit:context}}
              </p>
           </div>

<hr>
            <p class="translation">
            {{edit:translation}}

            </p>

        <div><div class="lang">
<br>
        {{srcLang}} → {{trgLang}}
        </div>

Styling

.card {
 font-family: arial;
 font-size: 25px;
 text-align: center;
 color: #333;
 background-color: white;
}
.hint, .context {
 font-size: 20px;
 text-align: ;
 font-style: italic;
 color: Gray
}


.lang {
   font-size: 10px; 
	color: red;
   text-align: left;
text-align: bottom;
text-transform: capitalize;
}

PS: it would be cool if you could add an optional tag to all imported words.
E.g. a field. It would also make it easier to delete accidental imports (where you import more than you wanted to etc.)

The Add-on does actually load in
Version ⁨23.10.1 (fac9e0ee)⁩
Python 3.9.15 Qt 5.15.2 PyQt 5.15.5

However, I have tried a few times, and the words do not get imported into the correct deck (deck name:) (every single time it gets imported into the same deck, which I am not able to change – no matter what I set the “deck name:” to )

and sometimes the translation only shows “…”, what does that mean?

I am new to the Reverso and Anki. It is a great solution to learn, but I have a problem adding this feature in Anki tools (Import Reverso). I followed the instructions and copied the code (2060267742) in Anki Adds-on but nothing happened. When I close Anki and open it again, I find the Add-on Startup Failed message. I clicked the check for Updates but no more updates are available. I am copying the Debug info, maybe it help to know how I add the Reverso import feature to Anki (Anki 23.12.1 (1a1d4d54) (ao)
Python 3.9.15 Qt 6.6.1 PyQt 6.6.1
Platform: Windows-10-10.0.22621

When loading Reverso importer:
Traceback (most recent call last):
File “aqt.addons”, line 245, in loadAddons
File “C:\Users\hossa\AppData\Roaming\Anki2\addons21\2060267742_init_.py”, line 1, in
from . import main
File “C:\Users\hossa\AppData\Roaming\Anki2\addons21\2060267742\main.py”, line 9, in
from . import gui
File “C:\Users\hossa\AppData\Roaming\Anki2\addons21\2060267742\gui.py”, line 5, in
from PyQt5 import QtCore, QtGui, QtWidgets
ModuleNotFoundError: No module named ‘PyQt5’

)

Thanks a lot
Hossam

Thanks for reporting,

in fact that’s something I was aware of since some 3 weeks and I plan to upgrade it shortly. Please stay tuned and I will surely address this issue.

As addressed some posts above, you can also install a QT5 version and it may work already.

Sandro

*:slight_smile:

That’s something I did experience myself. I completely miss how it works. I will try once again to make it out, but I make no promises.

I just uploaded version 1.8.0 of reverso add-on that is a porting to the latest anki versions. It solves

  • the issue with Qt6, it now works with both
  • it correctly saves options between sessions (creation of reverso card was particularly annoying)

It does not solve the issue with the target deck, but I posted a request for suggestions, let’s see if I get some help.
It currently does not refresh the UI when adding the reverso card, but it correctly adds them, at least.

The code is now published on github and patches are welcome even just to suggest best practices or better code (I’m definitely not savvy on Qt6).

1 Like

Hmm, I tried uninstalling and installing the add-on again
– I’m on version Version ⁨23.12.1 (1a1d4d54)⁩

It still doesn’t add the cards to the assigned deck.

@sandro , have you had the chance to check out the styling set-up I shared? :slight_smile:

Import from Reverso (version 1.8.0)

  • once I deleted the deck (just 1) all imports would go to no matter what I set the destination deck to;
    I get “default” as the deck name in browse mode.
    image

It’s weird… no matter what I do the cards don’t load into the assigned deck. v1.8.0 of the add-on
Version Version ⁨23.12.1 (1a1d4d54)⁩ of Anki.