Repository navigation
feat: tag vocabulary terms with a language (#52) - #57
Merged
Merged
Conversation
- config: VocabularyTerm(term, language); normalize accepts terms, dicts and legacy
strings, dedups by term across languages; select_vocabulary() picks the dictation's
language terms then All-languages terms (primary subtag match)
- persistence: JSON array of {"term", "language"} objects; legacy string lists load as
All languages and are rewritten on the next save
- stt/rewrite: both use the same select_vocabulary() pick for stt_language
- settings: Vocabulary tab is a Term | Language table with a per-row language combo
- docs and tests
Closes #52
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 4, 2026
Term cells are editable, so blank, duplicate or untrimmed rows could stay visible while the save dropped or normalized them. Repopulate the table from the normalized list when it differs. Co-Authored-By: Claude <noreply@anthropic.com>
DavidHruby1
added a commit
that referenced
this pull request
Nov 4, 2026
DavidHruby1
added a commit
that referenced
this pull request
Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #52. Foundation for #53, #54 and #55.
Changes
src/config.py):VocabularyTerm(term, language=""), where""= All languages.normalize_vocabulary_entriesacceptsVocabularyTerm,{"term","language"}dicts and legacystr. It validates the language withnormalize_language_code, dedups byterm.casefold()across the whole list (first occurrence wins) and keeps the existing limits (128 terms, 128 chars, 8,000 rendered chars).{"term","language"}objects. A legacy array of strings loads as All languages and is rewritten in the new format on the next save. Damaged data is still backed up tosettings-damaged.txt.select_vocabulary(entries, language): Auto picks only All-languages terms. Any other language picks that language's terms first, then All-languages terms, each group in list order. Languages match on the primary subtag (pt-br↔pt).config.stt_languagefrom the session snapshot.QTableWidgetwith an editable Term column and a Language column (aQComboBoxper row). The new-term combo lists All languages, built-in and common languages, favorites, and a saved code missing from those. Add / Update selected / Remove still work as before, with validation throughQMessageBox.docs/IMPLEMENTATION.md.Open question from the issue
"Allow the same term for several languages?" This PR keeps one label per term: a duplicate added under another language is merged, and the first one wins.
Tests
tests/test_vocabulary_languages.py: selection, migration, roundtrip, validation, request prompts and the settings dialog.test_roadmap_backends,test_roadmap_settingsandtest_profilesfor the new type.python -m unittest discover -s tests: 476 OK (5 skipped), andruff checkis clean.🤖 Generated with Claude Code