From 2436b2d320dc359522c6411808bf5db8ed51fb46 Mon Sep 17 00:00:00 2001 From: busya Date: Thu, 4 Jun 2026 16:17:36 +0300 Subject: [PATCH] feat(backend): add is_regex to dictionary API routes Add is_regex field to list, add, and edit dictionary entry API responses, and pass is_regex through to DictionaryEntryCRUD methods. --- backend/src/api/routes/translate/_dictionary_routes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/api/routes/translate/_dictionary_routes.py b/backend/src/api/routes/translate/_dictionary_routes.py index 754d8a4d..11425fdf 100644 --- a/backend/src/api/routes/translate/_dictionary_routes.py +++ b/backend/src/api/routes/translate/_dictionary_routes.py @@ -202,6 +202,7 @@ async def list_dictionary_entries( "context_data": e.context_data, "usage_notes": e.usage_notes, "has_context": e.has_context, + "is_regex": e.is_regex, "context_source": e.context_source, "origin_source_language": e.origin_source_language, "created_at": e.created_at, @@ -239,6 +240,7 @@ async def add_dictionary_entry( context_notes=payload.context_notes, source_language=payload.source_language, target_language=payload.target_language, + is_regex=payload.is_regex, ) logger.reflect("Entry added", {"entry_id": entry.id}) return { @@ -253,6 +255,7 @@ async def add_dictionary_entry( "context_data": entry.context_data, "usage_notes": entry.usage_notes, "has_context": entry.has_context, + "is_regex": entry.is_regex, "context_source": entry.context_source, "origin_source_language": entry.origin_source_language, "created_at": entry.created_at, @@ -289,6 +292,7 @@ async def edit_dictionary_entry( context_notes=payload.context_notes, source_language=payload.source_language, target_language=payload.target_language, + is_regex=payload.is_regex, ) logger.reflect("Entry updated", {"entry_id": entry_id}) return { @@ -303,6 +307,7 @@ async def edit_dictionary_entry( "context_data": entry.context_data, "usage_notes": entry.usage_notes, "has_context": entry.has_context, + "is_regex": entry.is_regex, "context_source": entry.context_source, "origin_source_language": entry.origin_source_language, "created_at": entry.created_at, @@ -343,7 +348,6 @@ async def delete_dictionary_entry( # @BRIEF Import entries into a terminology dictionary from CSV/TSV content. # @PRE User has translate.dictionary.edit permission. # @POST Entries are imported per conflict mode. -# @COMPLEXITY 4 @router.post("/dictionaries/{dictionary_id}/import") async def import_dictionary_entries(