1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-12 15:27:14 +03:00

[1812] Adapt Localized String Search

This commit is contained in:
David Sangrey 2024-04-24 19:58:39 -04:00
parent 26c8a8be6e
commit 4a1a107e03
No known key found for this signature in database
GPG Key ID: 3AEADBB0186884BC

View File

@ -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