mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-08-14 23:58:30 +00:00
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:
@ -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) + " "))
|
||||
|
Reference in New Issue
Block a user