From 5cfd94ac0f1bc3465793264a59efb2a88b12e722 Mon Sep 17 00:00:00 2001 From: 3Mydlo3 Date: Wed, 18 Dec 2024 23:03:32 +0100 Subject: [PATCH] Maybe this time --- tools/stringtable_validator.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/stringtable_validator.py b/tools/stringtable_validator.py index bde27a6..ad61b9a 100644 --- a/tools/stringtable_validator.py +++ b/tools/stringtable_validator.py @@ -57,9 +57,10 @@ def check_stringtable(filepath): if package_name.lower() != component_folder_name: # TODO: Check if it might be subaddon - subcomponent_folder_name = os.path.join(os.path.dirname(os.path.dirname(filepath)), component_folder_name) - if package_name.lower() != subcomponent_folder_name: - print(" ERROR: Package name attribute '{}' does not match any of component folder name '{}' and subcomponent '{}'.".format(package_name, component_folder_name, subcomponent_folder_name)) + parent_component_folder_name = os.path.basename(os.path.dirname(os.path.dirname(filepath))) + subcomponent_name = f"{parent_component_folder_name}_{component_folder_name}" + if package_name.lower() != subcomponent_name: + print(" ERROR: Package name attribute '{}' does not match any of component folder name '{}' and subcomponent '{}'.".format(package_name, component_folder_name, subcomponent_name)) errors += 1 # Get all keys contained in the stringtable