Add script to clean up after Crowdin

Crowdin does not delete files from translations when the main language
has a deleted file.

This script will do that job for them.
This commit is contained in:
lifehackerhansol 2023-09-29 20:30:42 -07:00
parent 77b6726033
commit 6c351c30d3
No known key found for this signature in database
GPG Key ID: 80FB184AFC0B3B0E
1 changed files with 16 additions and 0 deletions

16
clean_translations.py Normal file
View File

@ -0,0 +1,16 @@
import os
files_in_main = []
for i in os.listdir("_pages/en_US/"):
files_in_main.append(i)
for i in os.listdir("_pages/"):
if i == "en_US":
continue
for j in os.listdir(f"_pages/{i}"):
if j not in files_in_main:
print(f"Deleting _pages/{i}/{j}")
os.remove(f"_pages/{i}/{j}")