Skip to content

feat(commands): localize punctuation voice commands (#640) - #642

Draft
jatinkrmalik wants to merge 1 commit into
mainfrom
jatin/i18n-voice-commands-640-cb70
Draft

feat(commands): localize punctuation voice commands (#640)#642
jatinkrmalik wants to merge 1 commit into
mainfrom
jatin/i18n-voice-commands-640-cb70

Conversation

@jatinkrmalik

@jatinkrmalik jatinkrmalik commented Aug 4, 2026

Copy link
Copy Markdown
Member

Description

Voice command phrases (comma, period, new line, …) were hardcoded English-only. With recognition language set to Italian/French/etc. and voice commands enabled, spoken punctuation in that language was injected as literal words (#640).

This wires recognition language into CommandProcessor and merges localized punctuation / line-break aliases (IT, FR, DE, ES, PT, NL, PL, RU), while always keeping English phrases. Also adds English dot..

Related Issue

Fixes #640

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ✅ Test update

Changes

  • New command_phrases.py with locale alias maps keyed by Whisper ISO codes
  • CommandProcessor(language=…) / set_language() rebuilds aliases
  • SpeechRecognitionManager passes language on init and reconfigure
  • Punctuation attach-left spacing keyed by replacement char (works for all locales)
  • Docs / settings tooltip / PRODUCT.md updated
  • Tests for IT/FR/DE/ES/PT, English dot, auto (English-only aliases), and set_language

Out of scope

  • Localized action/format phrases (delete that, undo, capitalize, …) remain English
  • User-custom command phrases (already on roadmap)

Checklist

  • My code follows the code style of this project (black, isort)
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests pass locally
  • Pre-commit hooks pass (make lint)

Test plan

  • pytest tests/test_command_processor.py (40 passed)
  • make lint
  • Manual: set language to Italian, enable voice commands, dictate “ciao virgola mondo punto”
Open in Web Open in Cursor 

Voice command phrases were English-only even when recognition language
was set to Italian, French, etc. Merge locale punctuation/line-break
aliases from the recognition language into CommandProcessor, keep
English phrases available, and document the behavior.

Fixes #640

Co-authored-by: Jatin K Malik <jatinkrmalik@users.noreply.github.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation app Core Python application (src, packaging) web Next.js website tests Test suite changes labels Aug 4, 2026
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.70%. Comparing base (45acb10) to head (3840c06).

Files with missing lines Patch % Lines
...rc/vocalinux/speech_recognition/command_phrases.py 80.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #642   +/-   ##
=======================================
  Coverage   87.70%   87.70%           
=======================================
  Files          35       36    +1     
  Lines        6556     6590   +34     
  Branches     1088     1092    +4     
=======================================
+ Hits         5750     5780   +30     
- Misses        579      582    +3     
- Partials      227      228    +1     
Files with missing lines Coverage Δ
.../vocalinux/speech_recognition/command_processor.py 98.78% <100.00%> (+0.10%) ⬆️
...ocalinux/speech_recognition/recognition_manager.py 84.07% <100.00%> (+<0.01%) ⬆️
...rc/vocalinux/speech_recognition/command_phrases.py 80.00% <80.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

app Core Python application (src, packaging) documentation Improvements or additions to documentation tests Test suite changes web Next.js website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] voice command only available in english?

2 participants