Merge branch 'recloudstream-master'

This commit is contained in:
KillerDogeEmpire 2023-03-14 15:05:44 -07:00
commit 1d3a4c0468
1 changed files with 14 additions and 1 deletions

15
.github/locales.py vendored
View File

@ -1,6 +1,7 @@
import re
import glob
import requests
import lxml.etree as ET # builtin library doesn't preserve comments
SETTINGS_PATH = "app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsGeneral.kt"
@ -45,4 +46,16 @@ open(SETTINGS_PATH, "w+",encoding='utf-8').write(
"\n" +
END_MARKER +
after_src
)
)
# Go through each values.xml file and fix escaped \@string
for file in glob.glob(f"{XML_NAME}*/strings.xml"):
try:
tree = ET.parse(file)
for child in tree.getroot():
if child.text.startswith("\\@string/"):
print(f"[{file}] fixing {child.attrib['name']}")
child.text = child.text.replace("\\@string/", "@string/")
tree.write(file, encoding="utf-8", method="xml", pretty_print=True, xml_declaration=True)
except ET.ParseError as ex:
print(f"[{file}] {ex}")