Skip to content

Commit

Permalink
translations/allow_UNUSED_keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed May 16, 2024
1 parent 92d9deb commit b8dddbb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/sync_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
data = json.load(f)
for fid, samples in data.items():
if samples:
samples = [s for s in samples if s] # s may be None
samples = [s.strip() for s in samples
if s and s.strip() != "[UNUSED]"] # s may be None
with open(f"{locale}/{lang}/{fid}", "w") as f:
f.write("\n".join(sorted(samples)))

Expand All @@ -30,7 +31,8 @@
data = json.load(f)
for fid, samples in data.items():
if samples:
samples = [s for s in samples if s] # s may be None
samples = [s.strip() for s in samples
if s and s.strip() != "[UNUSED]"] # s may be None
with open(f"{locale}/{lang}/{fid}", "w") as f:
f.write("\n".join(sorted(samples)))

Expand All @@ -39,7 +41,8 @@
data = json.load(f)
for fid, samples in data.items():
if samples:
samples = [s for s in samples if s] # s may be None
samples = [s.strip() for s in samples
if s and s.strip() != "[UNUSED]"] # s may be None
with open(f"{locale}/{lang}/{fid}", "w") as f:
f.write("\n".join(sorted(samples)))

Expand All @@ -48,7 +51,8 @@
data = json.load(f)
for fid, samples in data.items():
if samples:
samples = [s for s in samples if s] # s may be None
samples = [s.strip() for s in samples
if s and s.strip() != "[UNUSED]"] # s may be None
with open(f"{locale}/{lang}/{fid}", "w") as f:
f.write("\n".join(sorted(samples)))

0 comments on commit b8dddbb

Please sign in to comment.