refactor(wordlens): rename "Word Wise" to "Word Lens" (#4633)

"Word Wise" is a Kindle trademark, so rename the inline-gloss feature to
"Word Lens" throughout the product.

- User-facing strings → "Word Lens" across all 34 locales; brand translated
  for Chinese (zh-CN 单词透镜, zh-TW 單詞透鏡) and German (Word-Lens-Daten).
- Code identifiers: WordWise→WordLens, wordWise→wordLens, WORD_WISE→WORD_LENS.
- Files/dirs: src/services/wordwise→wordlens, WordWisePanel→WordLensPanel,
  wordwise{Ruby,Section}.ts, build/sync scripts, test dirs/fixtures,
  data/wordwise→data/wordlens.
- Storage paths: CDN base, R2 key, on-device cache dir, WORDLENS_R2_BUCKET env,
  pnpm wordlens:{manifest,sync}. manifest.json is path-agnostic so its
  sha256/bytes stay valid (verified).
- biome.json: point the formatter-ignore at data/wordlens so the generated
  one-line gloss packs aren't pretty-printed on commit.

Migration notes:
- Re-run `pnpm wordlens:sync` to upload packs to cdn.readest.com/wordlens/.
- Persisted view-settings keys renamed (wordWiseEnabled/Level/HintLang and
  wordWiseAutoDownload) — saved values reset to defaults once on upgrade.
- Cached packs under the old Data/wordwise/ orphan (harmless re-download).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Huang Xin
2026-06-18 01:09:29 +08:00
committed by GitHub
parent 9d0c5dc524
commit c2ac207945
90 changed files with 539 additions and 2716 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ type NavWithConnection = Navigator & {
* Best-effort metered-connection detection. Returns `true` only when the
* Network Information API positively reports a cellular connection or the
* user's data-saver preference; returns `false` when the API is unavailable or
* inconclusive. Used to gate silent Word Wise pack auto-downloads.
* inconclusive. Used to gate silent Word Lens pack auto-downloads.
*/
export const isMetered = (): boolean => {
if (typeof navigator === 'undefined') return false;