Language Leaf

by cynthia-ding
5
4
3
2
1
Score: 50/100

Description

Language Leaf · 语叶:在 Obsidian 原生 Markdown 中阅读、查词、收录词句,并保存为 Spaced Repetition 闪卡。

Reviews

No reviews yet.

Stats

0
stars
107
downloads
0
forks
24
days
4
days
4
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
33
commits

Latest Version

5 days ago

Changelog

Language Leaf 0.6.0

新增独立学习库,支持库内主词库与本机其他笔记库连接,并改进原生 Markdown 阅读选词。

  • 学习资料、词条与复习卡片独立保存,保留卡片身份及 FSRS 进度;已迁移的学习库不再回写来源文章。
  • 设置提供创建、连接和追加导入学习库入口,支持校验学习库身份、保留调度历史及中断重试。
  • 主词库可使用笔记库内相对路径随笔记同步;其他笔记库的外部连接按设备保存,新设备需要重新绑定。
  • 复习服务支持共享配置冲突检测、额度竞争保护和可重建索引;锁、临时文件和会话等运行文件保留在同步目录之外。
  • 改进标题、列表、嵌套列表和任务列表选词,保留重复词的选区偏移与邻接译文;旧词典请求不会覆盖新查询。

最低支持桌面 Obsidian 1.14.4。未迁移的安装保留随文卡片模式,不自动搬迁已有笔记。升级前请备份学习数据;旧版本不能读取 schema 3 学习库,访问同一词库的窗口应一起升级。跨设备使用需先上传、再下载完成后学习,不支持多设备离线同时修改后的自动合并。本次不提供独立同步服务或移动端适配。

README file from

Github

Language Leaf

中文使用与开发说明

Read native Markdown, look up words and sentences, and save vocabulary as flashcards in the same note. Review with the built-in FSRS engine.

Installation and usage

Download main.js, manifest.json, and styles.css from the latest release. Copy them to <vault configuration folder>/plugins/language-leaf/, reload Obsidian, and enable Language Leaf in Community plugins. Preserve your existing data.json. Requires desktop Obsidian 1.14.4 or later.

  • Enable learning mode on a Markdown note. Hold Shift while selecting text, or configure Alt/Option. Three-finger selection can query when the modifier is released. Alternatively, enable automatic selection lookup or click the selection's lookup button.
  • Edit the new-word form and save with Command+Enter on macOS or Ctrl+Enter on Windows/Linux. The shortcut applies inside the new-word panel.
  • The selection lookup command works in both editing and reading views.
  • New cards always use the built-in FSRS engine.
  • Built-in FSRS review supports recall and context layouts, audio, daily new-card limits, undo, pause/resume, and source-note navigation. Space reveals the answer; arrow keys rate it after reveal.
  • Switching a note to editing exits learning mode.

Sentence context and repeated captures

For a target sentence with fewer than 15 words, Language Leaf includes one sentence before and after it by default. Change the word threshold and the number of sentences on each side in the reading and lookup settings; set either value to 0 to disable expansion. Changes apply to future captures only.

The original paragraph and line breaks are retained. Sentences already in that paragraph count toward the context range. Expansion stops at headings, code blocks, and ordinary blockquotes; translation callouts are skipped when locating original text. If a boundary falls inside quoted dialogue, the complete dialogue is included, so the range can exceed the configured sentence count. If the selected text occurs several times in the same paragraph, the original paragraph is retained without guessing which occurrence was selected.

When complete captured paragraphs all have matching translation callouts, their existing translations are kept in order. Otherwise, use optional automatic translation or enter the translation manually.

Capturing the same word or phrase again in the same note places the current example first and preserves earlier examples, meaning, notes, tags, and review progress. Selecting the same example again moves it to the front without adding a duplicate; whitespace-only differences are ignored. A successful capture can still increase the capture count. Opening an existing card for editing does not add an example or increase that count.

Across different notes, captures remain separate cards with their own source examples and review progress; the shared expression identity and existing meaning can be reused.

In built-in review, the first example is the main context. Context layout shows it before revealing the meaning and translation; recall layout shows it after reveal. After reveal, other examples are available in collapsed supplementary example sections containing their original text and translation. All examples belong to one card and receive one rating; examples do not rotate randomly.

Review data and migration

Card content stays in Markdown. Built-in review state is stored as append-only events under LinguaLeafData/review/ by default. Synchronize the entire data folder and resolve sync conflicts before continuing review.

Existing notes, vocabulary, and settings are not automatically migrated from the old Language Learner plugin.

Privacy and attribution

Enabled dictionaries receive the selected word or sentence. Optional context translation sends captured original paragraphs, including expanded neighboring context, to Youdao when a complete matching translation is unavailable. Online pronunciation uses dictionary recordings or Youdao audio. System speech uses voices available on the device through Obsidian; voice availability and quality depend on the system. Notes and review data stay in your vault; the plugin provides no remote data sync.

This project is derived from Language Learner by the_tree, retains dictionary and Vue panel code, and preserves the original MIT license and attribution. It is independently maintained by Cynthia Ding. Independent maintenance does not imply that inherited code was written from scratch.

The built-in review engine uses ts-fsrs 5.4.1, licensed under MIT. See third-party license.

Development

Use Node.js 22.12 or later:

npm ci
npm run test:run -- --pool=forks --maxWorkers=1 --no-file-parallelism
npm run build

Release assets are built and attested in GitHub Actions. See release notes and repository maintenance. Licensed under MIT.