jdlorimer/chinese-support-redux

Autofill Meaning stopped after upgrade to 0.13.0

Opened this issue · 5 comments

Describe the bug

$subject says it all - the autofill function does not fill the "Meaning" field anymore. I tried to add the label "Meaning" to the models/advanced.py, meta.json and config.json, but meta.json seems to get overwritten upon each start of Anki, and the Meaning field (ie, translation) does not get filled.

To Reproduce

  1. Try to "Add" a note using the Chinese (Advanced) model.
  2. Enter some Hanzi into the "Hanzi" field.
  3. Press "Tab" (autofill is on).
  4. Observe that several fields are being filled, but the naming field is not.

Expected behavior

Screenshots
If applicable, add screenshots to help explain your problem.

Specs (please complete the following information):

  • OS: Debian Buster
  • Anki Version v2.1.16
  • Chinese Support Version v0.13.0

Additional context

Sometimes, autofill does not appear to work at all, placing the cursor immediately in the "Traditional" field, but when I look at the note in the card browser, the fields are usually filled - except for the "Meaning" field.

Also, it used to be the case that if you erased the "Hanzi" field, the other fields would also all become erased. Now they all remain intact, which I find a major nuisance.

I have the same issue.

hans commented

Hi, it looks like this code change is responsible:

f986b66#diff-23e7e8550ef7b295fa5f9df762ccad14L66

An fix for the time being is to change your Meaning field to be named something that still matches the auto-fill's algorithm (e.g. "English"). I can confirm this fixes the problem on 0.13.0.

I can't remember when I updated the documentation, but this behaviour is intentional. The change was made to reduce code complexity - rather than having two ways to specify the language, there is now just one.

Not clearing all fields when clearing the Hanzi field may have been intentional, but either way, I think there are better ways to handle that use case (e.g. having a UI button to do this instead).

I'll keep this issue open as a reminder to add the UI button.

That you can't set the meta.json file to also support "Meaning" should be fixed with the pull request #136.