mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
Fix Localize with no space between parameters not being detected, fix paths
This commit is contained in:
parent
96561a4f3a
commit
bb4a8dc14e
|
@ -19,7 +19,7 @@ JSON_KEY_OLDTRANSL="old translations"
|
|||
JSON_KEY_OR="or"
|
||||
JSON_KEY_TR="tr"
|
||||
|
||||
SOURCE_LOCALIZE_RE=re.compile(br'Localize\("(?P<str>([^"\\]|\\.)*)"(, "(?P<ctxt>([^"\\]|\\.)*)")?\)')
|
||||
SOURCE_LOCALIZE_RE=re.compile(br'Localize\("(?P<str>([^"\\]|\\.)*)"(, ?"(?P<ctxt>([^"\\]|\\.)*)")?\)')
|
||||
|
||||
def parse_source():
|
||||
l10n = defaultdict(lambda: [])
|
||||
|
@ -114,13 +114,13 @@ if __name__ == '__main__':
|
|||
if(commenttxt):
|
||||
commenttxt = 'Context: '+commenttxt
|
||||
po.append(polib.POEntry(msgid=msg, msgstr="", occurrences=occurrences, msgctxt=ctxt, comment=commenttxt))
|
||||
po.save('data/languages/base.pot')
|
||||
po.save('datasrc/languages/base.pot')
|
||||
|
||||
for filename in os.listdir("data/languages"):
|
||||
for filename in os.listdir("datasrc/languages"):
|
||||
try:
|
||||
if (os.path.splitext(filename)[1] == ".json"
|
||||
and filename != "index.json"):
|
||||
filename = "data/languages/" + filename
|
||||
filename = "datasrc/languages/" + filename
|
||||
write_languagefile(filename, l10n_src, load_languagefile(filename))
|
||||
except Exception as e:
|
||||
print("Failed on {0}, re-raising for traceback".format(filename))
|
||||
|
|
Loading…
Reference in a new issue