From 86f265a39437cfe75d86d48c6cafa1afe0660448 Mon Sep 17 00:00:00 2001 From: cowboy <173278305+cowboy-1337@users.noreply.github.com> Date: Sat, 8 Mar 2025 00:38:13 -0800 Subject: [PATCH] Delete Scripts directory --- Scripts/Translations/find-unused.py | 39 ----------------------------- Scripts/Translations/prep.py | 11 -------- 2 files changed, 50 deletions(-) delete mode 100644 Scripts/Translations/find-unused.py delete mode 100644 Scripts/Translations/prep.py diff --git a/Scripts/Translations/find-unused.py b/Scripts/Translations/find-unused.py deleted file mode 100644 index 818296c..0000000 --- a/Scripts/Translations/find-unused.py +++ /dev/null @@ -1,39 +0,0 @@ -import re, glob - -directory = input("Enter project path (the one containing Bloxstrap.csproj): ") - -existing = [] -found = [] - -with open(f"{directory}\\Resources\\Strings.resx", "r") as file: - existing = re.findall("name=\"([a-zA-Z0-9.]+)\" xml:space=\"preserve\"", file.read()) - -for filename in glob.glob(f"{directory}\\**\\*.*", recursive=True): - if "\\bin\\" in filename or "\\obj\\" in filename or "\\Resources\\" in filename: - continue - - try: - with open(filename, "r") as file: - contents = file.read() - - matches = re.findall("Strings.([a-zA-Z0-9_]+)", contents) - for match in matches: - if not '_' in match: - continue - - ref = match.replace('_', '.') - if not ref in found: - found.append(ref) - - matches = re.findall("FromTranslation = \"([a-zA-Z0-9.]+)\"", contents) - for match in matches: - if not match in found: - found.append(match) - - except Exception: - print(f"Could not open {filename}") - continue - -for entry in existing: - if not entry in found and not "Enums." in entry: - print(entry) \ No newline at end of file diff --git a/Scripts/Translations/prep.py b/Scripts/Translations/prep.py deleted file mode 100644 index b5f0855..0000000 --- a/Scripts/Translations/prep.py +++ /dev/null @@ -1,11 +0,0 @@ -import glob, shutil, re - -exports = input("Path of folder of exported Crowdin files: ") -dest = input("Destination resources folder: ") - -for filename in glob.glob(f"{exports}\\**\\*.*", recursive=True): - print(f"Copying {filename}") - - localeCode = re.search("\\\\([a-zA-Z\\-]+)\\\\Strings.", filename).group(1) - - shutil.copy(filename, dest + f"\\Strings.{localeCode}.resx") \ No newline at end of file