jdlorimer / chinese-support-redux

Anki add-on providing support for Chinese study
https://ankiweb.net/shared/info/1128979221
GNU General Public License v3.0
101 stars 50 forks source link

Overwriting Hanzi field and then trigger auto fill doesn't change all fields. #137

Open jay-pee opened 4 years ago

jay-pee commented 4 years ago

Overwriting Hanzi field and then trigger auto fill doesn't change all fields like Pinyin, Bopomofo and English.

To Reproduce Steps to reproduce the behavior:

  1. Go to "add new card"
  2. Write 你好 in the Hanzi field
  3. Trigger auto complete
  4. Write 文 in the Hanzi field
  5. Trigger auto complete

Expected behavior Overwrite all the mentioned fields

Screenshots Screenshot from 2020-06-06 16-46-31

Specs (please complete the following information):

jay-pee commented 4 years ago

I read the code now and it seems, that this behavior is on purpose. For example in bahavior.py line 82 there is a check if the field for definitions (my case it is English) is empty: if get_first(config['fields'][field], note) == '':

What made you do this decision @luoliyan ? I would argue that you don't want a behavior where some fields are updated and some are not. So in both cases some fill-methods have to be adjusted...

Librose commented 4 years ago

I got stuck on step #3 above. How do you "trigger" auto complete? I have zero programming experience,

My problem is that the "meaning" field will not automatically fill in after I type in a Mandarin Chinese character/word. I have to type in the meaning in English myself.

Thanks for your help.