mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
[skip ci] match weblate xml style
This commit is contained in:
parent
67e278b2b7
commit
ad727b96cf
1 changed files with 4 additions and 1 deletions
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}")
|
||||
|
|
Loading…
Reference in a new issue