Fingertip Translation

by amos
5
4
3
2
1
Score: 32/100

Description

一款简洁高效的 Obsidian 划词翻译插件,支持多种翻译服务、触发方式和自动发音。

Reviews

No reviews yet.

Stats

5
stars
1,831
downloads
1
forks
130
days
47
days
47
days
2
total PRs
0
open PRs
0
closed PRs
2
merged PRs
1
total issues
1
open issues
0
closed issues
47
commits

Latest Version

2 months ago

Changelog

What's Changed

兼容性处理 Weave 系列插件,可把单词添加到指定的 Weave 牌组中

README file from

Github

Fingertip Translation

中文文档

A simple and efficient text translation plugin for Obsidian that supports multiple translation services, trigger modes, and automatic pronunciation.

Features

  • Selection Translation - Hold Ctrl and select text to translate, or use direct selection
  • Multiple Translation Services - Supports Bing Dictionary, Youdao (automatic Plus/Webpage switching), MyMemory
  • Dictionary Format - Bing/Youdao display part of speech and exam categories (CET-4, CET-6, etc.)
  • Auto Pronunciation - Automatically plays pronunciation after successful translation (toggleable)
  • Multiple Accents - Supports US English and UK English
  • Lightweight - No API Key required, works out of the box
  • Optional Weave integration - When the Weave memory plugin is enabled, the popover shows 加入复习 to save the looked-up word as a vocabulary card (no audio attachments). If Weave is not installed, the UI is unchanged.
  • Official lookup API - Other plugins can call getOfficialAPI().lookup(term) for dictionary results without opening the popover (used by Weave study UI to expand ::fingertip::word:: markers).

Installation

Method 1: Development Setup

git clone <repo-url>
cd obsidian-fingertip-translation
npm install
npm run dev

Method 2: Manual Installation

  1. Download or clone this repository
  2. Run npm run build to compile
  3. Copy main.js, styles.css, and manifest.json to your vault plugin folder:
    VaultFolder/.obsidian/plugins/fingertip-translation/
    
  4. Enable the plugin in Obsidian settings

Usage

  1. Select the text you want to translate in a note
  2. A popover will display the translation result (including phonetic symbols, part of speech, definitions)
  3. Click the speaker button to manually play pronunciation
  4. With "Auto Pronunciation" enabled, pronunciation plays automatically after successful translation
  5. Drag the popover to adjust its position
  6. Press ESC or click outside to close the popover

Settings

Option Description Default
Translation Service Bing Dictionary / Youdao / MyMemory Youdao
Trigger Mode Ctrl+Select / Direct Select Ctrl+Select
Pronunciation Source Youdao Audio / Browser TTS Youdao Audio
Auto Pronunciation Auto play after translation Off
Pronunciation Accent US English / UK English US English
Show Phonetic Display phonetic symbols On
Phonetic Mode Single accent / Both US and UK Both
Show Category Display CET-4, CET-6, etc. On

Tech Stack

  • Language: TypeScript
  • Bundler: esbuild
  • API: Obsidian requestUrl() (bypasses CORS)

Project Structure

src/
├── main.ts                       # Plugin main entry
├── settings.ts                   # Settings interface
├── tts.ts                        # Pronunciation (Web Speech API)
├── translator-mymemory.ts        # MyMemory Translation API
├── translator-bing.ts            # Bing Dictionary
└── translator-youdao-integrated.ts # Youdao Dictionary (Integrated Plus + Webpage)

styles.css                        # Popover styles
manifest.json                     # Plugin manifest

Translation Services

Service Free Quota API Key Dictionary Format Notes
Bing Dictionary Unlimited Not needed Part of speech Recommended
Youdao Dictionary Unlimited Not needed Collins/Exam/Category Auto fallback
MyMemory 1000/day Not needed None -

Youdao Features:

  • Prefers Plus API for richer data
  • Auto switches to webpage version when Plus API returns no match
  • Displays exam category tags (CET-4, CET-6, Gaokao, IELTS, TOEFL, etc.)
  • Shows US/UK accent labels for phonetics

Developer Guide

# Install dependencies
npm install

# Development mode (watch for changes and auto-compile)
npm run dev

# Production build
npm run build

License

BSD-0

References