Skip to content

Commit

Permalink
Move matching strings for single parameter call before strings concat…
Browse files Browse the repository at this point in the history
…enations
  • Loading branch information
srifqi committed Apr 27, 2024
1 parent 914be0d commit c56ce80
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions util/mod_translation_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,21 @@ def read_lua_file_strings(lua_file):
with open(lua_file, encoding='utf-8') as text_file:
text = text_file.read()

strings = []

for s in pattern_lua_quoted_single.findall(text):
strings.append(s[1])
for s in pattern_lua_bracketed_single.findall(text):
strings.append(s)

# Only concatenate strings after matching
# single parameter call (without parantheses)
text = re.sub(pattern_concat, "", text)

strings = []
for s in pattern_lua_quoted.findall(text):
strings.append(s[1])
for s in pattern_lua_bracketed.findall(text):
strings.append(s)
for s in pattern_lua_quoted_single.findall(text):
strings.append(s[1])
for s in pattern_lua_bracketed_single.findall(text):
strings.append(s)

for s in strings:
found_bad = pattern_bad_luastring.search(s)
Expand Down

0 comments on commit c56ce80

Please sign in to comment.