From 4a1a107e032a85074d232484acb43ad509ef0b10 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Wed, 24 Apr 2024 19:58:39 -0400 Subject: [PATCH] [1812] Adapt Localized String Search --- scripts/find_localised_strings.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/find_localised_strings.py b/scripts/find_localised_strings.py index ef861bb71..5911d64ca 100644 --- a/scripts/find_localised_strings.py +++ b/scripts/find_localised_strings.py @@ -38,8 +38,9 @@ def find_calls_in_stmt(statement: ast.AST) -> list[ast.Call]: out = [] for n in ast.iter_child_nodes(statement): out.extend(find_calls_in_stmt(n)) - if isinstance(statement, ast.Call) and get_func_name(statement.func) == '_': - out.append(statement) + if isinstance(statement, ast.Call) and get_func_name(statement.func) in ('tr', 'translations'): + if ast.unparse(statement).find('.tl') != -1 or ast.unparse(statement).find('translate') != -1: + out.append(statement) return out