mirror of
https://github.com/recloudstream/cloudstream.git
synced 2025-08-24 03:07:23 +08:00
[skip ci] match weblate xml style
This commit is contained in:
5
.github/locales.py
vendored
5
.github/locales.py
vendored
@ -1,6 +1,7 @@
|
||||
import re
|
||||
import glob
|
||||
import requests
|
||||
import os
|
||||
import lxml.etree as ET # builtin library doesn't preserve comments
|
||||
|
||||
|
||||
@ -61,6 +62,8 @@ for file in glob.glob(f"{XML_NAME}*/strings.xml"):
|
||||
with open(file, 'wb') as fp:
|
||||
fp.write(b'<?xml version="1.0" encoding="utf-8"?>\n')
|
||||
tree.write(fp, encoding="utf-8", method="xml", pretty_print=True, xml_declaration=False)
|
||||
fp.write(b'\n')
|
||||
# Remove trailing new line to be consistent with weblate
|
||||
fp.seek(-1, os.SEEK_END)
|
||||
fp.truncate()
|
||||
except ET.ParseError as ex:
|
||||
print(f"[{file}] {ex}")
|
||||
|
Reference in New Issue
Block a user