dracosh 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +25 -17
  2. package/locales/de.json +1098 -0
  3. package/locales/en.json +1081 -0
  4. package/locales/fr.json +1148 -0
  5. package/locales/pl.json +1173 -0
  6. package/locales/uk.json +1174 -0
  7. package/package.json +2 -2
  8. package/src/alerts.js +71 -4
  9. package/src/backup.js +2 -1
  10. package/src/cardline.js +71 -0
  11. package/src/cli.js +41 -54
  12. package/src/commands.js +14 -12
  13. package/src/demo.js +11 -0
  14. package/src/diff.js +20 -10
  15. package/src/i18n.js +68 -0
  16. package/src/judge.js +164 -13
  17. package/src/language.js +355 -0
  18. package/src/library.js +91 -38
  19. package/src/lock.js +2 -1
  20. package/src/manage.js +193 -58
  21. package/src/pause.js +1 -2
  22. package/src/progress.js +119 -63
  23. package/src/quiet.js +3 -2
  24. package/src/scheduler.js +26 -9
  25. package/src/session.js +118 -36
  26. package/src/settings.js +14 -6
  27. package/src/starter.js +36 -27
  28. package/src/store.js +11 -8
  29. package/src/tips.js +12 -3
  30. package/src/ui/AddCard.js +449 -81
  31. package/src/ui/AnswerInput.js +22 -10
  32. package/src/ui/App.js +209 -57
  33. package/src/ui/BadgeUnlock.js +5 -4
  34. package/src/ui/Badges.js +9 -8
  35. package/src/ui/Choice.js +14 -9
  36. package/src/ui/Companion.js +13 -13
  37. package/src/ui/Confetti.js +2 -2
  38. package/src/ui/Decks.js +167 -9
  39. package/src/ui/DieRoll.js +9 -9
  40. package/src/ui/Evolution.js +7 -7
  41. package/src/ui/Hatch.js +7 -6
  42. package/src/ui/Header.js +58 -16
  43. package/src/ui/Help.js +43 -25
  44. package/src/ui/Languages.js +167 -0
  45. package/src/ui/Mascot.js +1 -2
  46. package/src/ui/Missed.js +13 -12
  47. package/src/ui/Preview.js +48 -29
  48. package/src/ui/Reset.js +13 -14
  49. package/src/ui/Settings.js +27 -19
  50. package/src/ui/Stats.js +24 -23
  51. package/src/ui/Summary.js +30 -15
  52. package/src/ui/TheOne.js +7 -6
  53. package/src/ui/icons.js +1 -2
  54. package/src/ui/kit.js +34 -6
  55. package/src/vacation.js +2 -1
  56. package/src/words.js +8 -2
  57. package/data/tips.json +0 -32
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A gamified language or definitions trainer for your terminal. It sits in a spare pane, challenges you every few minutes, and a small pixel dragon grows up as you keep your streak going.
4
4
 
5
+ ![Dracosh in a terminal: a Spanish card answered right without its article, a typo forgiven, a miss with the right answer, a reveal graded by hand, and a new card added in one line](docs/demo.gif)
6
+
5
7
  ## Why Dracosh
6
8
 
7
9
  Learning a language usually means another hour in the evening, after a full day at the computer. I spent plenty of those evenings myself, and I wanted something that fits into the working day instead.
@@ -14,13 +16,19 @@ It's made for people who live in a terminal or spend most of the day at a comput
14
16
 
15
17
  - Your cards live in Dracosh's own library, organised in decks; no other app needs to be running
16
18
  - Add cards, start decks and switch between them right in the app (`/add`, `/decks`)
17
- - Each deck is asked both ways (kot → cat and cat → kot) or one way only, as you choose when you make it
18
- - Forgiving answer checks: case and punctuation don't matter, a missing Polish letter (ż, ó, ł…) still counts and shows the right spelling, one typo is fine on longer words, and after a miss you see letter by letter where you went wrong
19
- - Leitner boxes, so the cards you know come back less and less often; a card is only asked when it's due
20
- - Daily goal, streaks (weekends and days off don't break them) and 36 badges (one of them a secret)
19
+ - One line is a card: `el gato = the cat; the kitty // Mi gato duerme.` (`;` separates right answers, `//` adds an example). Paste a whole list and check it before it's saved
20
+ - Each deck is asked the way you pick after its first card: front → back, back → front, or both ways; change it any time in `/decks`
21
+ - Pronunciation, if you turn it on in `/settings`: once the answer is out, the word in the language you're learning in that deck is read aloud with a macOS voice (other systems later); decks in one language, like definitions, stay quiet
22
+ - Dracosh works out which languages a deck is in (Spanish → English, say) and which of the two you're learning, from the cards, the deck's name and your other decks, whatever language you use Dracosh in, and says when it's only a guess; set either in `/decks` when it can't tell or guesses wrong
23
+ - Type the answer, or press Enter with nothing typed to see it and say whether you knew it (`1` or `2`): handy for whole sentences, and it counts just the same
24
+ - Cloze cards for sentences: `I {{look forward}} to it` asks one gap at a time
25
+ - Forgiving answer checks: case and punctuation don't matter, a missing accent or special letter (ż, ł, é, ø…, and ß written as ss) still counts and the right spelling is shown with it marked, German "Baer" for "Bär" and Danish "aa" for "å" count too, an article can be left out in English ("cat" for "the cat"), while a missing or wrong article where it carries the gender ("Hund" for "der Hund") or a German umlaut left plain ("Bar" for "Bär") counts as almost: right, but the card stays at its level, one typo is fine on longer words, and after a miss you see letter by letter where you went wrong. Chinese, Japanese and Korean answers are checked exactly
26
+ - Leitner boxes, so the cards you know come back less and less often; a card is only asked when it's due, and can be done any time on that day; up to 20 new cards a day, and the rest are said to be waiting for tomorrow
27
+ - Daily goal, streaks (weekends, days off and days with nothing to practise don't break them) and 36 badges (one of them a secret)
21
28
  - A pixel dragon that hatches from an egg, evolves over a year of streaks, blinks, and falls asleep if you ignore it
22
29
  - 8-bit sound effects, generated from code
23
- - A short tip about Dracosh while you wait for the next card
30
+ - Now and then, a short tip about Dracosh while you wait for the next card
31
+ - Speaks English, Polish, German, French and Ukrainian: it follows your system's language, and `/settings` switches it
24
32
 
25
33
  ## Install
26
34
 
@@ -30,14 +38,14 @@ You need Node 22 or newer.
30
38
  npm install -g dracosh
31
39
  ```
32
40
 
33
- A fresh install starts with a short "Getting started" deck: a tour where every card tells you what to type and shows you one more thing Dracosh can do. When you're through, `/add` starts your own deck and the tour makes room for it. Importing decks (from Anki, CSV and more) is on the way, see [What's next](#whats-next).
41
+ A fresh install starts with a short "Getting started" deck, in the app's language: a tour where every card tells you what to type and shows you one more thing Dracosh can do. When you're through, `/add` starts your own deck and the tour makes room for it. Importing decks (from Anki, CSV and more) is on the way, see [What's next](#whats-next).
34
42
 
35
43
  Want a look first? `dracosh --preview` shows every screen and animation on made-up data.
36
44
 
37
45
  ## Usage
38
46
 
39
47
  ```bash
40
- dracosh --deck "Polish" # quiz this deck, this run only (otherwise the one picked in /decks)
48
+ dracosh --deck "Spanish" # quiz this deck, this run only (otherwise the one picked in /decks)
41
49
  dracosh --every 5m # a card every 5 minutes instead of 10, this run only
42
50
  dracosh --no-sound
43
51
  dracosh --stats # print your progress and exit
@@ -46,15 +54,15 @@ dracosh --preview
46
54
  dracosh restore # list your backups; dracosh restore 2 brings one back
47
55
  ```
48
56
 
49
- Type the answer and press Enter; don't know it? Press Enter with nothing typed to see the answer. Press `/` for commands:
57
+ Type the answer and press Enter. Not sure, or the answer is a whole sentence? Press Enter with nothing typed: the answer shows up, then press `1` if you didn't know it or `2` if you did. Press `/` for commands:
50
58
 
51
59
  | Command | What it does |
52
60
  | --- | --- |
53
- | `/add` | add cards to one of your decks, or start a new deck |
54
- | `/decks` | switch to another deck (Dracosh remembers it), or start a new one |
61
+ | `/add` | add cards to one of your decks, or start a new deck (one line per card, ↑ fixes the last one) |
62
+ | `/decks` | switch to another deck (Dracosh remembers it), start a new one, or press → to change how a deck is asked and which languages it's in |
55
63
  | `/hint` | reveal one more letter |
56
- | `/correct` | your answer was right after all; it's accepted from now on |
57
- | `/settings` | interval, daily goal, sound, quiet hours, weekends, tips, and a reset |
64
+ | `/correct` | your answer was right after all; after a yes it's accepted from now on |
65
+ | `/settings` | language, rhythm (a card every few minutes, or a study session), interval, daily goal, sound, pronunciation, quiet hours, weekends, tips, and a reset |
58
66
  | `/stats` | streak and a calendar of your month |
59
67
  | `/badges` | all badges and how to get them |
60
68
  | `/companion` | your dragon, its element and the forms ahead |
@@ -81,18 +89,18 @@ npm link # puts `dracosh` on your PATH
81
89
  npm test
82
90
  ```
83
91
 
84
- The quiz logic in `src/session.js` and `src/progress.js` does no I/O, which keeps it easy to test. The UI is built with [Ink](https://github.com/vadimdemedes/ink) and lives in `src/ui/`. Sound effects are generated by `scripts/make-sounds.js` (`npm run sounds`).
92
+ The quiz logic in `src/session.js` and `src/progress.js` does no I/O, which keeps it easy to test. The UI is built with [Ink](https://github.com/vadimdemedes/ink) and lives in `src/ui/`; every text it shows is in `locales/en.json`, read through `t("key")` from `src/i18n.js`.
93
+
94
+ The other languages live next to it in `locales/`, the tour included. `npm test` checks that each one has every English key, the same `{placeholders}` and all the plural forms its language needs. If you're a native speaker and something reads oddly, a pull request is very welcome. Sound effects are generated by `scripts/make-sounds.js` (`npm run sounds`). The demo at the top is recorded with [VHS](https://github.com/charmbracelet/vhs): `vhs docs/demo/demo.tape` writes `docs/demo.gif` from a throwaway deck in `/tmp`.
85
95
 
86
96
  ## What's next
87
97
 
88
- Dracosh now keeps its own card library, with a short tour and `/add` to start your own deck. Coming next, roughly in this order:
98
+ Coming next, roughly in this order:
89
99
 
90
- - Card types: definitions and question and answer decks, not just words. For each deck you choose whether you type the answer or just check yourself.
91
- - More languages: decks in any language, with answer checking that forgives a missing accent in European languages and Cyrillic (other scripts are checked exactly), and the app itself in English, Polish, German, French and Ukrainian.
92
100
  - Import and export: Anki (plain-text exports and `.apkg` decks from AnkiWeb), CSV, JSON and pasted lists, and export back to Anki.
93
101
  - Decks and cards in the app: browse, edit and delete with undo, plus a welcome flow for new users.
94
102
  - Optional AI help for writing cards, with your own API key or a local model.
95
- - Linux and Windows.
103
+ - Linux and Windows, pronunciation there included.
96
104
 
97
105
  ## License
98
106