lnaba.reisen

ArkLing

Last edited by D, 2026-10-20 ; finished

Back to Projects

arkling.lnaba.reisen

Project source

github.com/gggentooo/arkling

Screenshot of ArkLing on Safari

About this project

ArkLing is an Arknights game script based language learning tool. Learn more about it in its GitHub repository.

The site was built with assistance from Antigravity; its first rendition was absolute slop (repetitive and inconsistent styling everywhere, highly questionable file splitting choices, inability to use proper HTML elements and making everything either a div or a button, etc) so I had to manually redo most of it. Then I discovered that I had ~200 free Copilot credits left and made it refactor the sloppy parts all over again.

The following mini-technical document was generated using an AI agent. The source code is also released under GPL3; feel free to reference it if you’re trying to build a similar project, etc.

What convinced you this was a good idea for a language learning tool?

Sexy Chinese dragons and their rapturing speech, surely there’s much to learn from them.

Jokes aside, I’m a firm believer of the idea that languages are meant to be immersed in. Modern video game scripts happen to be a collection of (often multilingual) good quality conversational language usage. Which make them good language learning resources, in my opinion. Plus, using something I’m already interested in helps me stay focused and motivated while learning.

There are a lot of great Arknights story readers out there, but none of them support native side-by-side views of multiple languages at the same time. I used to use this site, with two Chrome tabs open in side-by-side view; after a few chapters I’ve decided why not just make a specialized tool just for myself.

I’ve released this tool via Twitter(link) and, to my surprise and gratitude, received lots of feedback and thank-yous from fellow Doctors. If you’ve used ArkLing yourself and found it to be helpful, I’m honored to have taken part in your language learning journey. Good luck, and have fun!

If you have any questions or comments regarding the project, feel free to let me know via my email: d@lnaba.reisen.

Credits

External libraries used

Game data source

Technical document

Runtime structure

State and data flow

src/lib/state/learningState.svelte.ts owns language selection, learning mode, annotation settings, loaded script lines, and revealed focused-mode lines. src/lib/state/storySelectorState.svelte.ts owns category/chapter/episode selection, loading state, and story metadata. Both managers use Svelte 5 runes ($state and $derived) and are exported as shared singleton instances.

At startup, StorySelector loads the story review table, restores valid URL query indexes, and loads the selected episode. A story load fetches target and system raw scripts, parses them, aligns them by position, stores the resulting ScriptLine[], and applies the active annotation settings. Selector changes repeat the same load path. The URL is updated with cat, chap, and ep indexes after restored state is valid.

MainArea renders StorySelector twice by design. The bottom instance is a convenience control for changing stories without scrolling back to the top; it is not redundant markup to remove during cleanup.

Annotation toggles update state, generate cached markup asynchronously, and replace only the latest request’s result. The toggle handler waits for the annotation operation and Svelte’s DOM flush before adjusting window.scrollBy, keeping the same visible line in place when ruby/pinyin markup changes line height.

External services

src/lib/api/arknights.ts fetches public raw JSON and text files from GitHub repositories:

The app requests gamedata/excel/story_review_table.json and gamedata/story/<story path>.txt. Story tables are cached in memory and sessionStorage; scripts are cached in memory. Japanese annotation initialization uses a local dict/ asset path and falls back to the Kuromoji dictionary CDN if the local dictionary is unavailable. Google Fonts are imported by src/app.css.

Parsing and annotation loop