Skip to content

Commit 3ef3cd3

Browse files
committed
Update translations to fix invalid format strings
1 parent 0903490 commit 3ef3cd3

File tree

14 files changed

+21
-0
lines changed

14 files changed

+21
-0
lines changed

scripts/i18n_validate.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env python3
2+
import os
3+
4+
import polib
5+
6+
os.chdir(os.path.dirname(os.path.realpath(__file__)))
7+
8+
errors = 0
9+
for filename in os.listdir("../src/locale"):
10+
if not filename.endswith(".mo"):
11+
continue
12+
for entry in polib.mofile(f"../src/locale/{filename}"):
13+
i = 0
14+
while f"{{{i}}}" in entry.msgid:
15+
if f"{{{i}}}" not in entry.msgstr:
16+
print(f"[{filename[:-3]}] {entry.msgid}\n\t{entry.msgstr}")
17+
errors += 1
18+
break
19+
i += 1
20+
print(f"\n{errors} problem(s) found" if errors else "✅ No problems found")

scripts/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Pillow
22
poeditor
3+
polib
34
python-dotenv
45
requests

src/locale/bn.mo

10 Bytes
Binary file not shown.

src/locale/ca.mo

184 Bytes
Binary file not shown.

src/locale/cs.mo

4 Bytes
Binary file not shown.

src/locale/da.mo

9 Bytes
Binary file not shown.

src/locale/es.mo

1.26 KB
Binary file not shown.

src/locale/fr.mo

-203 Bytes
Binary file not shown.

src/locale/ja.mo

1.34 KB
Binary file not shown.

src/locale/jv.mo

2.71 KB
Binary file not shown.

0 commit comments

Comments
 (0)