supervertaler 1.9.116__py3-none-any.whl → 1.9.131__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- Supervertaler.py +438 -103
- modules/shortcut_manager.py +29 -1
- modules/termview_widget.py +9 -2
- modules/unified_prompt_library.py +12 -9
- modules/unified_prompt_manager_qt.py +355 -112
- {supervertaler-1.9.116.dist-info → supervertaler-1.9.131.dist-info}/METADATA +37 -3
- {supervertaler-1.9.116.dist-info → supervertaler-1.9.131.dist-info}/RECORD +11 -11
- {supervertaler-1.9.116.dist-info → supervertaler-1.9.131.dist-info}/WHEEL +0 -0
- {supervertaler-1.9.116.dist-info → supervertaler-1.9.131.dist-info}/entry_points.txt +0 -0
- {supervertaler-1.9.116.dist-info → supervertaler-1.9.131.dist-info}/licenses/LICENSE +0 -0
- {supervertaler-1.9.116.dist-info → supervertaler-1.9.131.dist-info}/top_level.txt +0 -0
modules/shortcut_manager.py
CHANGED
|
@@ -18,9 +18,15 @@ class ShortcutManager:
|
|
|
18
18
|
"file_new": {
|
|
19
19
|
"category": "File",
|
|
20
20
|
"description": "New Project",
|
|
21
|
-
"default": "
|
|
21
|
+
"default": "",
|
|
22
22
|
"action": "new_project"
|
|
23
23
|
},
|
|
24
|
+
"editor_focus_notes": {
|
|
25
|
+
"category": "Edit",
|
|
26
|
+
"description": "Focus Segment Note Tab (Ctrl+N)",
|
|
27
|
+
"default": "Ctrl+N",
|
|
28
|
+
"action": "focus_segment_notes"
|
|
29
|
+
},
|
|
24
30
|
"file_open": {
|
|
25
31
|
"category": "File",
|
|
26
32
|
"description": "Open Project",
|
|
@@ -542,6 +548,28 @@ class ShortcutManager:
|
|
|
542
548
|
"action": "copy_source_to_target",
|
|
543
549
|
"context": "grid_editor"
|
|
544
550
|
},
|
|
551
|
+
"editor_add_to_dictionary": {
|
|
552
|
+
"category": "Editor",
|
|
553
|
+
"description": "Add word at cursor to custom dictionary",
|
|
554
|
+
"default": "Alt+D",
|
|
555
|
+
"action": "add_word_to_dictionary",
|
|
556
|
+
"context": "grid_editor"
|
|
557
|
+
},
|
|
558
|
+
"editor_open_quickmenu": {
|
|
559
|
+
"category": "Editor",
|
|
560
|
+
"description": "Open QuickMenu for AI prompt actions",
|
|
561
|
+
"default": "Alt+K",
|
|
562
|
+
"action": "open_quickmenu",
|
|
563
|
+
"context": "grid_editor"
|
|
564
|
+
},
|
|
565
|
+
"editor_show_context_menu_double_shift": {
|
|
566
|
+
"category": "Editor",
|
|
567
|
+
"description": "Show context menu (double-tap Shift)",
|
|
568
|
+
"default": "", # Requires AutoHotkey script: supervertaler_hotkeys.ahk
|
|
569
|
+
"action": "show_context_menu_double_shift",
|
|
570
|
+
"context": "grid_editor",
|
|
571
|
+
"note": "Requires AutoHotkey. Run supervertaler_hotkeys.ahk for this feature."
|
|
572
|
+
},
|
|
545
573
|
|
|
546
574
|
# Filter Operations
|
|
547
575
|
"filter_selected_text": {
|
modules/termview_widget.py
CHANGED
|
@@ -941,13 +941,20 @@ class TermviewWidget(QWidget):
|
|
|
941
941
|
for quote_char in '\"\'\u201C\u201D\u201E\u00AB\u00BB\u2018\u2019\u201A\u2039\u203A':
|
|
942
942
|
normalized_text = normalized_text.replace(quote_char, ' ')
|
|
943
943
|
|
|
944
|
+
# CRITICAL FIX v1.9.118: Strip punctuation from glossary term before matching
|
|
945
|
+
# This allows entries like "...problemen." (with period) to match source text
|
|
946
|
+
# where tokenization strips the period during word splitting
|
|
947
|
+
# Comprehensive set of quote and punctuation characters to strip
|
|
948
|
+
PUNCT_CHARS = '.,;:!?\"\'\u201C\u201D\u201E\u00AB\u00BB\u2018\u2019\u201A\u2039\u203A'
|
|
949
|
+
normalized_term = source_lower.rstrip(PUNCT_CHARS).lstrip(PUNCT_CHARS)
|
|
950
|
+
|
|
944
951
|
# Use word boundaries to match complete words/phrases only
|
|
945
952
|
if ' ' in source_term:
|
|
946
953
|
# Multi-word term - must exist as exact phrase
|
|
947
|
-
pattern = r'\b' + re.escape(
|
|
954
|
+
pattern = r'\b' + re.escape(normalized_term) + r'\b'
|
|
948
955
|
else:
|
|
949
956
|
# Single word
|
|
950
|
-
pattern = r'\b' + re.escape(
|
|
957
|
+
pattern = r'\b' + re.escape(normalized_term) + r'\b'
|
|
951
958
|
|
|
952
959
|
# Try matching on normalized text first, then original
|
|
953
960
|
if not re.search(pattern, normalized_text) and not re.search(pattern, text_lower):
|
|
@@ -171,11 +171,14 @@ class UnifiedPromptLibrary:
|
|
|
171
171
|
# Backward compatibility: quick_run is the legacy field; internally we
|
|
172
172
|
# treat it as the "QuickMenu (future app menu)" flag.
|
|
173
173
|
prompt_data.setdefault('quick_run', False)
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
# Support legacy quickmenu_quickmenu field (rename to sv_quickmenu)
|
|
175
|
+
if 'quickmenu_quickmenu' in prompt_data:
|
|
176
|
+
prompt_data['sv_quickmenu'] = prompt_data['quickmenu_quickmenu']
|
|
177
|
+
prompt_data['sv_quickmenu'] = bool(
|
|
178
|
+
prompt_data.get('sv_quickmenu', prompt_data.get('quick_run', False))
|
|
176
179
|
)
|
|
177
180
|
# Keep legacy field in sync so older code/versions still behave.
|
|
178
|
-
prompt_data['quick_run'] = bool(prompt_data['
|
|
181
|
+
prompt_data['quick_run'] = bool(prompt_data['sv_quickmenu'])
|
|
179
182
|
|
|
180
183
|
# New QuickMenu fields
|
|
181
184
|
prompt_data.setdefault('quickmenu_grid', False)
|
|
@@ -270,7 +273,7 @@ class UnifiedPromptLibrary:
|
|
|
270
273
|
'name', 'description', 'domain', 'version', 'task_type',
|
|
271
274
|
'favorite',
|
|
272
275
|
# QuickMenu
|
|
273
|
-
'quickmenu_label', 'quickmenu_grid', '
|
|
276
|
+
'quickmenu_label', 'quickmenu_grid', 'sv_quickmenu',
|
|
274
277
|
# Legacy (kept for backward compatibility)
|
|
275
278
|
'quick_run',
|
|
276
279
|
'folder', 'tags',
|
|
@@ -309,8 +312,8 @@ class UnifiedPromptLibrary:
|
|
|
309
312
|
prompt_data['_relative_path'] = relative_path
|
|
310
313
|
|
|
311
314
|
# Keep legacy field in sync
|
|
312
|
-
if '
|
|
313
|
-
prompt_data['quick_run'] = bool(prompt_data.get('
|
|
315
|
+
if 'sv_quickmenu' in prompt_data:
|
|
316
|
+
prompt_data['quick_run'] = bool(prompt_data.get('sv_quickmenu', False))
|
|
314
317
|
self.prompts[relative_path] = prompt_data
|
|
315
318
|
|
|
316
319
|
self.log(f"✓ Saved prompt: {prompt_data.get('name', relative_path)}")
|
|
@@ -456,8 +459,8 @@ class UnifiedPromptLibrary:
|
|
|
456
459
|
return False
|
|
457
460
|
|
|
458
461
|
prompt_data = self.prompts[relative_path]
|
|
459
|
-
new_value = not bool(prompt_data.get('
|
|
460
|
-
prompt_data['
|
|
462
|
+
new_value = not bool(prompt_data.get('sv_quickmenu', prompt_data.get('quick_run', False)))
|
|
463
|
+
prompt_data['sv_quickmenu'] = new_value
|
|
461
464
|
prompt_data['quick_run'] = new_value # keep legacy in sync
|
|
462
465
|
prompt_data['modified'] = datetime.now().strftime("%Y-%m-%d")
|
|
463
466
|
|
|
@@ -493,7 +496,7 @@ class UnifiedPromptLibrary:
|
|
|
493
496
|
"""Update cached QuickMenu (future app menu) list (legacy name: quick_run)."""
|
|
494
497
|
self._quick_run = []
|
|
495
498
|
for path, data in self.prompts.items():
|
|
496
|
-
is_enabled = bool(data.get('
|
|
499
|
+
is_enabled = bool(data.get('sv_quickmenu', data.get('quick_run', False)))
|
|
497
500
|
if not is_enabled:
|
|
498
501
|
continue
|
|
499
502
|
label = (data.get('quickmenu_label') or data.get('name') or Path(path).stem).strip()
|