From 197a0e0c5e4f9b8b3f2c674951bce370ef6b4c78 Mon Sep 17 00:00:00 2001 From: Rick Calixte <10281587+rcalixte@users.noreply.github.com> Date: Tue, 8 Oct 2024 19:40:00 -0400 Subject: [PATCH] Update validation to check for invalid translation files (#764) --- validate-spice | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/validate-spice b/validate-spice index 9d22baa3..ac1e33f7 100755 --- a/validate-spice +++ b/validate-spice @@ -40,6 +40,11 @@ def validate_xlet(uuid): if len(glob.glob("files/*/po/*.pot")) > 1: raise CheckError(f"[{uuid}] Too many .pot files!") + # Check if there are any improperly named file(s) + for file in glob.glob("files/*/po/*"): + if not (file.endswith(".po") or file.endswith(".pot")): + raise CheckError(f"[{uuid}] Invalid file found in translation directory: {file}") + found = False for root, dirs, files in os.walk("files/%s" % uuid): if any(ext.endswith(".po") for ext in files) and not any(ext.endswith(".pot") for ext in files):