[Web] Translation practice sheet generator: successor of Koichi's 4500 sentences?

A few years back, Koichi from Tofugu made a wonderful exercise sheet, which consisted of… 4500 sentences in Japanese, that you had to translate. With no solution sheet. The thing is, his idea is actually - and perhaps surprisingly - deeply rooted in the science of learning. You can learn more about it here.

Alas, things have happened and this exercise sheet is not available anymore. With no indication of a chance to see it resurface, I’ve took it into my own hands to try and make a replacement for it for WaniKani users.

Here is the result: a simple tool (it fits in one small JS script) running on your device that fetches all the example sentences you’ve seen in WaniKani and generates a printable PDF.

Translation practice sheet generator

And you can find its GitHub repo here.

If the script doesn’t work:
Try another browser or device, that might fix it (the script runs on your device so it’s sensitive to those things). Whether it does or not, don’t hesitate to tell me your OS version, your browser version and what went wrong, I’ll have a look into it.

Update: There were a few hiccups at the beginning, but it looks like the tool works pretty well now!

22 Likes

WHOA! This is amazing, I’m not sure what I was expecting but 162 pages of practice sentences generated in a second is beyond it. I can definitely see myself working on my pdf little by little for a while. Thank you for this, I look forward to generating my final sheet once I reach level 60.

5 Likes

Truly amazing. This came just at the right time for me.

3 Likes

Is this still working ? i get Failed to fetch data or generate PDF

I’m really glad it’s so helpful ^^

I hesitated to randomize the sentences but I didn’t for people like you who want to do this exercise several times. That way when you reach level 60 - or a bit before - you can just print from the 162nd/163rd page and you’ll have just the sentences you haven’t translated before. Of course you can still do it from the beginning all over again ^^

1 Like

OS version? Browser version? That would help me try to fix it. Otherwise just use another browser or device and it should do the trick ^^

I’m having trouble with two browsers (see details in dropdowns below):

Windows 11 Operating System

Google Chrome Version 128.0.6613.138 (Official Build) (64-bit)


image

Microsoft Edge Version 128.0.2739.79 (Official build) (64-bit)


image

@HA472 Thank you for the screenshots, very helpful.

My best bet is a problem related to rate-limiting which would explain things working well until trying to fetch the 1645 sentences, though I’m not 100% sure as taiyousea didn’t seem to have any problem even at level 40.

In any case, I improved the code to handle rate-limiting correctly, you can retry it now and hopefully it works! I also added better logging for errors which should avoid a lot of guesswork in the future.

And @rocktheboat this update might have fixed it for you too

1 Like

I just can’t thank you enough for the generator. That’s really amazing! Thanks!

2 Likes

My pleasure ^^

Thanks for taking a look at the issue. I also tried:

  • Windows 11 & Firefox
  • MacBook Sonoma 14.5 & Chrome
  • MacBook Sonoma 14.5 & Safari
  • MacBook Sonoma 14.5 & Firefox

The only difference in the error message (NetworkError) was for: MacBook Air 2018 Sonoma 14.5 & Firefox

MacBook Air 2018 Sonoma 14.5

Firefox 109.0.1 (64 bit) & Network Error Message

The difference in the error message is simply related to me updating the script to give more detailed errors. If you try again with your other configurations - not that you need to - you should get the same error.

Basically, this NetworkError means it’s not a problem with the API, instead the script running locally in your browser tab tries to contact the WaniKani server but fails.

My best theories for what might be going wrong:

  • a specific ad-blocker or privacy extension blocking the requests
  • your firewall blocking the requests
  • I might have made a mistake when handling rate-limiting and the WaniKani website blocks me completely without answering

To go around all of this:

  • You can try the tool from your phone while connected to the mobile network with any adblocker/VPN/… deactivated
  • If you want you can also send me a read-only API key by email and I’ll try examining what goes wrong in the network tab of the developer tools. If everything you tried still didn’t fix it I think there’s a good chance I’ll be able to reproduce the issue here, and if I can’t I’ll simply send you the PDF back ^^
1 Like

I can see on network tab a CORS error and also an error 414-requestURI too long.
The OPTIONS being sent has a really huge URL:
https://api.wanikani.com/v2/subjects?types=vocabulary&ids=2467,2468,2471,2470,2475,2485,2500,2469,2479....it goes on and on and on

Thank you for the info!

About the CORS error (“Cross-Origin Resource Sharing” error, occurs when a web page tries to access resources from a different domain without proper permissions), is there even something I can do? You might know better than I do so I welcome your thoughts, but I’m under the impression that it’s probably a problem with the client, that may be caused by an Adblocker, very restrictive privacy settings or something like that.

I made the URL request in several chunks by limiting to 500 IDs at the same time, hopefully that fixed the issue ^^ (see commit for the curious)

1 Like

that worked perfectly, 294 pages of practicing for me, thank you very much!

1 Like

My pleasure, がんばって ^^

Thanks! It is also working for me now.

1 Like

The problems from everyone else are now fixed, so most likely the tool now works for you ^^

Yep works for me now thanks

1 Like

the other day this didn’t work for me, but now it works perfectly, thank you!

very nice resource

1 Like