Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Cantonese Jyutping was not working #176

Open
ahj10 opened this issue Jan 24, 2021 · 2 comments
Open

Cantonese Jyutping was not working #176

ahj10 opened this issue Jan 24, 2021 · 2 comments

Comments

@ahj10
Copy link

ahj10 commented Jan 24, 2021

The Cantonese Jyutping was not working when I downloaded it. I ended up adding code to the database.py file in the main folder of this anki addon. I also had to erase the ~100 Jyutping entries in the Jyutping column in the cidian section of the database.db (this is not essential, but helps). I don't use the Jyutping option in Anki--> Chinese --> phonetics --> Jyutping. I continue to use the "Pinyin" option.

Here is my database.py edited file:
9e19d81

For reference, this is the error I get if I use the Jyutping option (even after my edit to database.py). This was not important for me to fix, since it is working with my database.py file now. It will auto fill the Cantonese field in my card with the color I want. So all is well.

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools>Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-ons section of our support site.
Debug info:
Anki 2.1.15 (442df9d6) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3
Platform: Mac 10.13.3
Flags: frz=True ao=True sv=1
Add-ons possibly involved: Chinese Support Redux v0140

Caught exception:
File "aqt/webview.py", line 27, in cmd
File "aqt/webview.py", line 87, in _onCmd
File "aqt/webview.py", line 368, in _onBridgeCmd
File "aqt/editor.py", line 273, in onBridgeCmd
File "anki/hooks.py", line 39, in runFilter
File "/Users/ajorge/Library/Application Support/Anki2/addons21/1128979221/edit.py", line 74, in onFocusLost
if update_fields(note, field, allFields):
File "/Users/ajorge/Library/Application Support/Anki2/addons21/1128979221/behavior.py", line 269, in update_fields
fill_color(hanzi, copy)
File "/Users/ajorge/Library/Application Support/Anki2/addons21/1128979221/behavior.py", line 156, in fill_color
field = get_first(config['fields'][field_group], note)
<class 'KeyError'>: 'jyutping'

@jdlorimer
Copy link
Owner

Jyutping has never worked particularly well and hasn't been a priority (since most users seem to be learning Mandarin exclusively).

I'll try to incorporate your changes in the next revision.

@exrulez
Copy link

exrulez commented Sep 25, 2021

OMG I've been looking like a madman for this! Thank you.
I replaced the database.py file, selected "Pinyin" and tried it.
It filled the Cantonese field with jyutping, but it's color is incorrect. It's also not filling the colorCantonese fields. Were these ones not part of the change?

Thank you again, and I'm so happy to find this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants