Fix lang issue closing for no reason
This commit is contained in:
+16
-16
@@ -95,7 +95,7 @@ if __name__ == "__main__":
|
|||||||
dashboard_ref = polib.pofile(dashboard_pot)
|
dashboard_ref = polib.pofile(dashboard_pot)
|
||||||
|
|
||||||
for lang in args.lang:
|
for lang in args.lang:
|
||||||
|
lang_issues = 0
|
||||||
for po_ref, po in ((client_ref, os.path.join(locale_dir, lang, "wivrn.po")),
|
for po_ref, po in ((client_ref, os.path.join(locale_dir, lang, "wivrn.po")),
|
||||||
(dashboard_ref, os.path.join(locale_dir, lang, "wivrn-dashboard.po"))):
|
(dashboard_ref, os.path.join(locale_dir, lang, "wivrn-dashboard.po"))):
|
||||||
if not os.path.exists(po):
|
if not os.path.exists(po):
|
||||||
@@ -110,23 +110,23 @@ if __name__ == "__main__":
|
|||||||
if not i.msgid in entries:
|
if not i.msgid in entries:
|
||||||
missing = missing + 1
|
missing = missing + 1
|
||||||
print(f"::notice file={po}::{flag(lang)} Translation for {repr(i.msgid)} is missing")
|
print(f"::notice file={po}::{flag(lang)} Translation for {repr(i.msgid)} is missing")
|
||||||
|
lang_issues += missing
|
||||||
|
|
||||||
if missing > 0:
|
if missing > 0:
|
||||||
print(f"::warning file={po}::{flag(lang)} {missing} translations missing")
|
print(f"::warning file={po}::{flag(lang)} {missing} translations missing")
|
||||||
|
|
||||||
if args.manage_issues:
|
if args.manage_issues:
|
||||||
issues = [i for i in repo.get_issues(state="all", labels = [ISSUE_LABEL]) if i.title == ISSUE_TITLE.format(lang=lang)]
|
issues = [i for i in repo.get_issues(state="all", labels = [ISSUE_LABEL]) if i.title == ISSUE_TITLE.format(lang=lang)]
|
||||||
if not issues:
|
if lang_issues > 0:
|
||||||
issue = repo.create_issue(
|
if issues:
|
||||||
title=ISSUE_TITLE.format(lang=lang),
|
|
||||||
labels = [ISSUE_LABEL]
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
for issue in issues:
|
|
||||||
if issue.state != "open":
|
|
||||||
issue.edit(state = "open")
|
|
||||||
else:
|
|
||||||
if args.manage_issues:
|
|
||||||
issues = [i for i in repo.get_issues(state="open", labels = [ISSUE_LABEL]) if i.title == ISSUE_TITLE.format(lang=lang)]
|
|
||||||
for issue in issues:
|
for issue in issues:
|
||||||
issue.edit(state = "closed")
|
if issue.state != "open":
|
||||||
|
issue.edit(state="open")
|
||||||
|
else:
|
||||||
|
issue = repo.create_issue(
|
||||||
|
title=ISSUE_TITLE.format(lang=lang),
|
||||||
|
labels=[ISSUE_LABEL]
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
for issue in issues:
|
||||||
|
issue.edit(state="closed")
|
||||||
|
|||||||
Reference in New Issue
Block a user