Skip to content

Commit 31fb4c2

Browse files
committed
fix(tools_qt): make translations function more flex
1 parent f091f50 commit 31fb4c2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tools_qt.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1558,8 +1558,11 @@ def tr(message, context_name="giswater", aux_context='ui_message', default=None,
15581558
# Format the value with named or positional parameters
15591559
if list_params:
15601560
try:
1561+
# Ensure list_params is iterable (tuple or list)
1562+
if not isinstance(list_params, (list, tuple)):
1563+
list_params = (list_params,)
15611564
value = value.format(*list_params)
1562-
except (IndexError, KeyError):
1565+
except (IndexError, KeyError, TypeError):
15631566
pass
15641567

15651568
return value

0 commit comments

Comments
 (0)