Skip to content

feat: bulk-import words into the custom dictionary#343

Open
hanselstner wants to merge 1 commit intoOpenWhispr:mainfrom
hanselstner:feat/dictionary-import
Open

feat: bulk-import words into the custom dictionary#343
hanselstner wants to merge 1 commit intoOpenWhispr:mainfrom
hanselstner:feat/dictionary-import

Conversation

@hanselstner
Copy link

Summary

Adds a bulk-import dialog to the custom dictionary, allowing users to paste a list of words/phrases separated by commas, semicolons, or line breaks instead of adding them one by one.

Changes

  • src/components/DictionaryView.tsx: Add import button and dialog with multi-line text input, smart parsing (lines first, then comma/semicolon split), word count preview, and case-insensitive deduplication against existing dictionary
  • All 10 locale files: Add importButton, importTitle, importDescription, importPlaceholder, importCount, importConfirm, importCancel translation keys

Test plan

  1. Open Dictionary → click Import button
  2. Paste words separated by commas: Kubernetes, Docker, Vue.js → should show 3 words
  3. Paste words separated by line breaks → each line becomes a word
  4. Paste mixed format (lines + commas) → lines split first, then commas within each line
  5. Verify technical terms with dots/special chars are preserved (e.g., Vue.js, .tsx)
  6. Import words that already exist → duplicates should be skipped
  7. Verify empty lines and whitespace-only entries are filtered out

Pull Request opened by Augment Code with guidance from the PR author

Add an "Import" dialog to the Custom Dictionary view that lets users
paste a list of words or phrases separated by commas, semicolons, or
line breaks.  This is useful for quickly onboarding domain-specific
vocabulary (e.g. technical terms, brand names, framework names).

The parser splits input by lines first, then by comma/semicolon within
each line.  This preserves terms that contain dots (Vue.js, babylon.js,
.tsx) because the dot is never treated as a delimiter.  Duplicate
detection is case-insensitive and prevents re-adding existing words.

UI integration:
- Empty state: "Import" link below the example chips
- Populated state: "Import" button in the header next to "Clear all"
- Modal dialog with textarea, live word count, and confirm/cancel

Full i18n support across all 10 languages (en, de, es, fr, it, ja,
pt, ru, zh-CN, zh-TW).
@gabrielste1n
Copy link
Collaborator

been meaning to do this thanks @hanselstner will review asap

@hanselstner
Copy link
Author

@gabrielste1n I found a few small areas for improvement, so I added a few things. Otherwise, it's now complete. Thank you very much for all your hard work on this truly great tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants