readest/apps
Huang Xin dcf6d5407f
feat(wordlens): add the en-vi gloss pack, sync incrementally (#5737)
* feat(wordlens): add the en-vi gloss pack

WikDict publishes no en-vi dictionary, so this pair is built with the existing
kaikki `build` mode, which reads the Vietnamese `translations` off each English
Wiktionary entry. The pack ships 9759 entries and 10813 inflections, lemmatized
through the en-en table like every other English-source pack, so difficulty is
gated by the lemma rank (whispered -> whisper, reluctantly -> reluctant).

Vietnamese is a target language only. Its words are multi-syllable with spaces
inside them ("hoc sinh"), so the planner's whitespace tokenizer would gloss
syllables rather than words; a vi-en pack needs a segmenter first, like ja/ko/th.
No code gates this, the pack simply does not exist, which is how every unbuilt
pair already behaves.

Coverage is thinner than its peers (9759 vs 14769 for en-es), which reflects
Wiktionary's English to Vietnamese translation coverage rather than the build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* perf(wordlens): sync only the packs that changed

A data refresh usually touches a single pair, but the sync re-uploaded all 15
packs (~20 MB) on every run. The published manifest already carries each pack's
sha256, so fetch it and upload only the packs that are new or changed. Adding
en-vi now uploads 652 KB instead of 20 MB.

An unreachable manifest (first sync, offline) falls back to a full upload, and
--force does the same on demand, for when the manifest is current but an object
was deleted from the bucket.

Also stop publishing the manifest when a pack upload failed. The script always
claimed the manifest goes last so it never points at a missing pack, but it
uploaded the manifest regardless of failures, which is exactly the state that
invariant exists to prevent.

planSync is pure and unit tested. Guarded the CLI entry point behind the direct
execution check that build-wordlens-data.mjs already uses, so importing the
module in tests does not run main().

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 09:10:23 +02:00
..
readest-app feat(wordlens): add the en-vi gloss pack, sync incrementally (#5737) 2026-08-16 09:10:23 +02:00
readest-calibre-plugin fix(sync): merge book metadata on its own clock so page turns cannot clobber edits (#5438) (#5442) 2026-08-02 15:46:39 +02:00
readest.koplugin chore(koplugin): build nightly plugin zip and default to device targets (#5699) 2026-08-14 09:49:25 +02:00