Updated translations from @tispokes

Amended translate.py and created a batch script to ease of running the translations.

Co-Authored-By: Lars Pöpperl <45465820+tispokes@users.noreply.github.com>
This commit is contained in:
Philip Abbey
2025-08-09 13:42:55 +01:00
parent ad8a895f58
commit e9f6ccfd0d
4 changed files with 41 additions and 13 deletions

View File

@ -90,7 +90,7 @@ titleIds: list[str] = []
# the previous strings with the current ones if they exist.
# """
# out = prev.__copy__()
# for s in curr.find(name="strings").findAll(name="string"):
# for s in curr.find(name="strings").find_all(name="string"):
# s_prev = out.find(name="string", attrs={"id": s["id"]})
# if s_prev:
# s_prev.string = s.string
@ -124,7 +124,7 @@ with open("./resources/strings/strings.xml", "r") as f:
translator.translate("Generated by Google Translate from English") + "\n"))
soup.find(name="strings").insert_before("\n\n")
for s in soup.find(name="strings").findAll(name="string"):
for s in soup.find(name="strings").find_all(name="string"):
s.insert_before(" ")
if s["id"] in exceptionIds:
continue
@ -142,7 +142,7 @@ with open("./resources/strings/strings.xml", "r") as f:
s.string = a.title()
else:
s.string = a
for s in soup.find(name="strings").findAll(
for s in soup.find(name="strings").find_all(
string=lambda text: isinstance(text, Comment)):
s.insert_before(" ")
s.replace_with(Comment(" " + translator.translate(s) + " "))