Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing definition/translation when we learn characters from pinyin #44

Open
Nicollivier opened this issue Feb 6, 2024 · 6 comments
Open

Comments

@Nicollivier
Copy link

Nicollivier commented Feb 6, 2024

There is 2 ways to practice the learn characters with your package:

  1. you provide the pinyin and the definition/translation and we have to draw it -> it's fantastic to learn !! Thx !!!
  2. you provide only the pinyin, without any definition and we have to visualize the character. the "issue" here is the fact that there is no definition and we can have several different characters with the same pinyin. So is it possible to had the definition, as for the 1, in order to be sure to get the correct character?

my bad, just realized I did not provide more details about conf: iOS version (23.12.1)

@krmanik
Copy link
Owner

krmanik commented Feb 8, 2024

The meaning fields need to add in case of 2. Thanks for feedback, I will update the deck.

@krmanik
Copy link
Owner

krmanik commented Feb 11, 2024

I have updated the card template but it is better to update manually. Copy these lines and paste in card template to Card 4, the question for Card 4 is What is the characters?

Check front.html of Card 4

<hr>

<div id="char_meaning" class="meaning-card">{{Meaning}}</div>

<script>
var hideList = ['char_sim', 'char_trad'];
function showHide(type, isShow, style = "inline") {
    if (isShow) {
        document.querySelectorAll(type).forEach(function (val) {
            val.style.display = style;
        });
    } else {
        document.querySelectorAll(type).forEach(function (val) {
            val.style.display = 'none';
        });
    }
}

for (var _hide of hideList) {
    var el = document.getElementById(_hide);
    if (el) {
        el.style.display = "none";
    }
    if (_hide == "char_sim") {
        showHide("#char-sim-id", false);
    }
    if (_hide == "char_trad") {
        showHide("#char-trad-id", false);
        showHide(".sep", false);
    }
}
</script>

image

@Nicollivier
Copy link
Author

Thanks for the update, so far I’m honestly not sure to understand how to add your code 😅 I Will try when I will be back home with my desktop version.
Meanwhile I’ve created a test profile to test your update and you might have some issues with icons below the solution, some text are shown instead of symbols (I’m using with iPhone to write this comment and did not find the way to add screenshot, the entry below seems not working).

My conf: iOS last update, last package from Anki uploaded yesterday and Ank version 23.12.1

@krmanik
Copy link
Owner

krmanik commented Feb 15, 2024

The deck can be update by following these steps.

  1. Review till the question come up What is the characters?
  2. Then Edit -> Tools -> Card Template
  3. Then paste above provided HTML/JS below model footer and above <script> // v1.0.0

@Nicollivier
Copy link
Author

Done, finally managed to understand how to do it. It was not difficult but did not look at the right place...

So it's working thx.
However I've the "Zhuyin" character displayed but I've not activated the option.

@krmanik
Copy link
Owner

krmanik commented Feb 21, 2024

I have found another easier way to update the card template.

Download and import this deck in Anki and select Update notetypes -> always, after that delete the Update deck.

Download
https://github.com/krmanik/Anki-xiehanzi/releases/download/v2.2.1/Type.1.-.New.HSK.3.0.Mandarin.Chinese__Update.apkg


image

So it's working thx. However I've the "Zhuyin" character displayed but I've not activated the option.

You have to turn of during review then from next card the Zhuyin will be hidden.

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

No branches or pull requests

2 participants