seth-js / yomichan-es

A Spanish hover dictionary. It's a modified version of Yomichan that works with Spanish (Castilian).
15 stars 2 forks source link

The 'Model' in the custom Yomichan doesn't work so I cannot create cards #2

Closed HIKORIN01 closed 1 year ago

HIKORIN01 commented 1 year ago

I don't think it's registering, so whenever I try to create a card it won't let me

seth-js commented 1 year ago

The model is set up for my deck. You need to change the deck and model selection to work with yours. If you want to keep the layout I use, you need to have the same fields I use. The deck name and model name can be whatever you want.

deck

yomichan-fields

Make sure you have the AnkiConnect addon installed.

HIKORIN01 commented 1 year ago

I have AnkiConnect installed, but even though I copied everything into a specific model I keep getting a 'Template render error' message. Am I doing something wrong?

seth-js commented 1 year ago

I'm setting everything up on another computer. Let me see if I get the error. Sharing the entire Yomichan settings JSON may be overkill. I might just rewrite the instructions to include relevant information to get the Forvo server working with Yomichan and turning Layout-aware scanning on.

seth-js commented 1 year ago

I just set it up, and everything's working. After creating a new Anki deck and model and setting up the fields to match with what was provided in the settings JSON, I turned the Enable Anki integration option off and on. This updates Yomichan's data on what decks and models are currently in Anki. Can you show me your Anki card format window?

HIKORIN01 commented 1 year ago

pesos

seth-js commented 1 year ago

There's a typo in the Sentence field. </strong? should be </strong>.

HIKORIN01 commented 1 year ago

Changed it, still the same error

seth-js commented 1 year ago

Can you post an image of the Template render error message? Also, you may want to try going to the bottom of the settings page and clicking Reset Settings. After doing that you need to:

HIKORIN01 commented 1 year ago

Side Note: Is it normal to have to reinstall the dictionary every time close and open the Firefox profile?

HIKORIN01 commented 1 year ago

thealamo

It goes on to list the other parts of the card afterwards.

HIKORIN01 commented 1 year ago

Also the changes you suggested didn't change anything.

When I reset my settings and followed the instructions I wasn't about to select anything in the deck and model area, that is, nothing would come up on the popup.

Then, after re-importing the settings, the same 'template render error' issue occurred.

seth-js commented 1 year ago

Sorry for wasting all your time like that. I've been trying yomichan-es on different computers and never got the same error, but I didn't think to try out the Firefox setup. The second I set everything up on Firefox instead of Chromium, I also received the error. Looking inside the console, I see this error: Content Security Policy: The page’s settings blocked the loading of a resource at eval (“default-src”). The error happens in handlebars.min.js. CSP is preventing Yomichan from loading stuff it needs for the handlebars templates.

I'll have to figure out how to fix this now. In the meantime, can you try using this on a Chromium-based browser instead (Chrome, Brave, etc.)? Make sure you import the same settings JSON. I realized that the instructions I wrote earlier are still missing some necessary changes.

Side Note: Is it normal to have to reinstall the dictionary every time close and open the Firefox profile?

I also just noticed this too. It's weird because when I first released yomichan-ru, Firefox would have everything set up even if the browser restarted. It looks like Firefox changed how that works. Once again, just use the Chromium setup while I try to figure out what's going on. I may have to create a Firefox addon file for all the settings to stay.

seth-js commented 1 year ago

Everything is now working with Firefox. I'm no longer getting the Template render error message. Yomichan settings and the dictionary are saved even after restarting the browser. I ended up downloading a stable version of Yomichan specifically for Firefox, and applying the changes to that. Now all the problems are gone. I also removed some CSS I accidentally left in the Custom CSS option. These fixes will be uploaded some time tomorrow. The readme will also be slightly changed.

seth-js commented 1 year ago

I did the changes. Hopefully everything has been uploaded correctly. Reset Yomichan if it is still installed, remove the dictionary, remove the add-on, and then follow the new instructions. Now I'll have to update yomichan-fr as well.

HIKORIN01 commented 1 year ago

Even with the new directions and the new settings file I am still getting the same error.

HIKORIN01 commented 1 year ago

Was there a new version of the dictionary?

seth-js commented 1 year ago

I just set up the Firefox version on another computer, and the error's not coming up with the new instructions. At this point, I think it has something to do with how your personal Firefox is set up. There's nothing else I can do. My recommendation is for you to use the Chromium version of the add-on.