CJK Cross-Script Search

by sai1047976
5
4
3
2
1
Score: 35/100

Description

This plugin has not been manually reviewed by Obsidian staff. Type 萬維鋼 and find 万维钢 (and vice versa) in global search. Uses OpenCC to expand queries across Simplified and Traditional Chinese.

Reviews

No reviews yet.

Stats

stars
downloads
0
forks
1
days
NaN
days
NaN
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits

Latest Version

Invalid date

Changelog

README file from

Github

Type 萬維鋼 in Obsidian's global search and find files containing 万维钢. And vice versa.

What it does

Obsidian's native global search (Cmd+Shift+F / Ctrl+Shift+F) treats Simplified and Traditional Chinese as different strings — searching 萬維鋼 will not surface a note that only contains 万维钢. This plugin closes that gap by rewriting your query using Obsidian's native OR syntax before it hits the search engine.

It also bridges common Taiwan/Mainland term variants like 軟體軟件软件 via OpenCC's s2tw / tw2s mapping.

Both typing into the search box and programmatic search calls are covered. CJK input methods (注音 / 拼音 / 日文 / 한국어) are not disrupted — the plugin pauses rewriting during IME composition so the candidate window keeps working normally.

Where it works

  • ✅ Global search panel (Cmd+Shift+F / Ctrl+Shift+F) — both user typing and programmatic calls
  • ❌ Quick Switcher (Cmd+O) — use lazyloong/obsidian-fuzzy-chinese for that
  • ❌ Tag pane / backlinks pane — deferred to v2

What gets expanded

Input Matches
萬維鋼 files containing 萬維鋼 or 万维钢
万维钢 files containing 万维钢 or 萬維鋼
軟體 files containing 軟體, 軟件, or 软件 (Taiwan variant only)
path:筆記/ 萬維鋼 path: operator passes through; 萬維鋼 expanded
/萬維鋼/ left as-is (you wrote a regex, plugin trusts you)
MIT unchanged (no CJK)
unchanged (single CJK char threshold)

Under the hood, 萬維鋼 becomes (萬維鋼 OR 万维钢) — Obsidian's native OR operator, not a regex blob. Your input box keeps showing what you typed; only the underlying query gets expanded.

Settings

  • Enable cross-script search — master toggle.
  • OpenCC variantTaiwan (default, bridges Taiwan idioms like 軟體↔软件) or Basic (char-level only, fewer false positives).
  • Debug log to console — prints every rewritten query so you can see what's being sent to search.

Compatibility

  • Obsidian ≥ 1.5.0 required. Earlier versions exposed different search internals; this build was designed against the current internal API.
  • Desktop and mobile both supported (no isDesktopOnly).

Known limitations

  • Quick Switcher / tag pane / backlinks not covered. See "Where it works".
  • Negated terms (-廢文) are not expanded.
  • The Taiwan variant can produce false positives for terms with the same form but different meaning across regions (e.g. 程序 means "program" in Mainland but also "procedure" in Taiwan). If this bothers you, switch to Basic.
  • Hooks Obsidian internals (SearchView.setQuery prototype + SearchComponent.changeCallback per-instance). An Obsidian upgrade that renames these may temporarily break the plugin until updated.
  • Bundle size ~2 MB (OpenCC dictionaries). One-time cost; lazy-loading on first query keeps startup fast.

Install (manual, while pending community-store approval)

  1. Download main.js and manifest.json from Releases.
  2. Drop both into <your-vault>/.obsidian/plugins/cjk-cross-search/.
  3. Reload Obsidian and enable the plugin in Settings → Community Plugins.

Build from source

git clone https://github.com/sai1047976/obsidian-cjk-cross-search
cd obsidian-cjk-cross-search
npm install
npm run build

The build emits main.js in the repo root. Drop that plus manifest.json into your vault's plugin folder.

License

MIT. See LICENSE.