Kanji Search - Related words and English-to-Japanese mnemonics

Developer to developer, well done for actually starting an idea and completing it!

I have a spreadsheet where I have the ‘groups’ like this, like birthplace, to be born, to give birth, and looking up 生まれ I see it’s got all those there, and more. Very nice!

Only thing I find a little weird (and this is being super picky) is the Jisho and WaniKani links being buttons with events attached rather than anchor elements. Not using the native element and having buttons pretend to be links means you can’t right click and choose where you want them to open, also it’s confusing for people using screenreaders. If you put the role=“link” attribute on there that will fix the accessibility issue, or you can make them actual links and then style them as buttons. Aside from that, looking good!

4 Likes

Thanks for the feedback! I’ve added role=“link” for now. You do have a good point. I’ll consider making the Jisho and WaniKani links actual links in the future.

1 Like

I have spent too much of my life fixing accessibility bugs, but not being able to right click on the link bugged me (because I had no way of knowing if it would open in a new tab, or not) so I figured I would point it out. :slightly_smiling_face:

4 Likes

I don’t know how much work it would be, but it would be great to be able to see your script when expanding the details of an item during reviews/lessons (on the second full expansion when pressing SPACE). I very rarely look at the actual item pages, and so I don’t really ever see your script!

It certainly seems like it could be very useful though, and the website is really nice. Great work!

2 Likes

Interesting. I’ll have to look into it. I use WaniKani as a dictionary, but you just made me realize that I’m the weird one :rofl: After using WaniKani for years things start to invert / get flipped upside down.

1 Like

In case you want to add your info section also to the lessons and reviews but don’t want to deal with observing the item info expansion/handling the differences between script compatibility mode on/off, you could use my Item Info Injector library script (it’s released under the MIT-0 license, so there’s no need for attribution or anything).

6 Likes

I’ll take my time to read through and understand your helper script. It looks really nice. Thanks so much for bringing it to my attention :pray:

1 Like

I updated my user script to use the WK Item Info Injector script from @Sinyaven. I enabled my notes everywhere (lesson,lessonQuiz,review,extraStudy,itemPage) and tested nowhere other than item details pages.

I’ve burned 9025 words, so I literally can’t test it. I’ve created a new account, but it will take some time to work through the radical lessons before getting to kanji/vocabulary. I decided to be reckless because I only have 15 users atm. @ALL Please help me test it. I can rollback the changes ASAP if needed.

5 Likes

Great, it seems to be working fine during reviews! I’ll let you know if I notice anything broken that needs fixing :slight_smile:

1 Like

Hi! Thank you for sharing your great work!

Le’ts talk about “a bug” slight_smile
I don’t quite understand why there are two groups for the kanji 虫

Bug
    • [虫] (むし) Bug, Insect
    • [昆虫] (こんちゅう) Insect, Bug
    • [毛虫] (けむし) Caterpillar
    • [蜂] (はち) Bee, Hornet, Wasp
    • [蛍] (ほたる) Firefly, Lightning Bug, Glowworm
    • [蚊] (か) Mosquito
    • [蝶] (ちょう) Butterfly
    • [蝶々] (ちょうちょう) Butterfly
    • [虫] (むし) Bug, Insect
    • [毛虫](けむし) Caterpillar
    • [弱虫] (よわむし) Weakling, Coward
    • [虫歯](むしば) Cavity, Decayed Tooth, Tooth Decay
    • [泣き虫] (なきむし) Crybaby
    • [無視する](むしする) To Ignore, To Disregard
    • [蒸し暑い] (むしあつい) Humid, Hot And Humid
    • [蒸し返す](むしかえす) To Rehash, To Bring Up Again, To Drag Up, To Reheat
    • [寧ろ] (むしろ) Rather, Better, Instead

Isn’t a “third” group needed? The third group would contain homophones:

  • [無視する](むしする) To Ignore, To Disregard
    • [蒸し暑い] (むしあつい) Humid, Hot And Humid
    • [蒸し返す](むしかえす) To Rehash, To Bring Up Again, To Drag Up, To Reheat
    • [寧ろ] (むしろ) Rather, Better, Instead

Words that are not related to “bugs” ?

There is one small visual bug with your script and the Breeze Dark style during lessons:
Anything which is not a link seems to be styled as a button - and the buttons aren’t styled as buttons :laughing:


This seems to be the CSS causing it:
image


Not sure if there’s anything you can do about it?
Thanks!

1 Like

Also, one issue not specific to Breeze Dark, is that as you can see in my screenshot there’s no distinction between the groups - in this example one group has the word at the start and one at the end, so it’s impossible to tell what belongs where!
image
On your website they’re easily distinguishable because of the shading:

Thanks for your great work with all this!

1 Like

About the “bug” related words. The first group groups bugs/insects. The second group groups all words that contain むし. I’m happy with the two groups the way they are.

@Hubbit200 there should be a blank line between groups to separate them. Are you sure it’s not Breeze Dark or another user script? Do you have the same problem on the details page?

This is what it looks like for me:

BTW, I’ll delete
若い物(わかいもの、not on WK)Young Thing
since I think it’s wrong. Jisho says 若い物 also means Young Person.

The details page appears with the blank line as you say, it’s only in lessons/reviews that it doesn’t appear. I’ve tried with Breeze Dark turned off and all scripts except yours turned off and it still happens.

1 Like

I’ve updated my script to add style to counter the Breeze Dark button style issue. The fix is specific to lessons. I don’t know if there is a similar issue for reviews.

1 Like

@Kellamity I’ve made the Jisho and WaniKani links on the Kanji Search site actual links like you suggested. They still look the same, but you can now right-click, ctrl-click, press Enter, etc.

It seems that in lessons and reviews there is the CSS rule p, pre { margin: 1em 0; }. I tried adding margin-top: 0 to your .ks-note li > p rule and the grouping seems to be fixed.

I also noticed a problem with the CSS injection during lessons/reviews: the callback function you provide in wkItemInfo.append() might get called multiple times (because there are multiple items in a review session), so injectStyle(css) will add your CSS several times to the page.

2 Likes

I’ve fixed the margin issue. I’ve also added logic to prevent duplicate style injection. @Sinyaven you’re a life-saver :+1:

3 Likes