From 2dcf8c93c69f00cacd0dc14ff8c4fc1de2f5cf67 Mon Sep 17 00:00:00 2001 From: R3voA3 Date: Sun, 25 Aug 2024 16:55:35 +0200 Subject: [PATCH] fixed wrong localization key formatting of contributing.md fixed check_strings.py not working --- CONTRIBUTING.md | 7 +- .../main/attributesObject/eventHandlers.hpp | 2 +- addons/main/stringtable.xml | 2 +- tools/check_strings.py | 109 ------------------ 4 files changed, 5 insertions(+), 115 deletions(-) delete mode 100644 tools/check_strings.py diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7563edbd..a69f6a34 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,7 +24,6 @@ You can help us by adding more translations for this modification. Read below to * Save the stringtable.xml * Create a pull request - -# [Translation Stats](https://github.com/RevoArma3/3den-Enhanced/blob/master/TRANSLATIONSTATS.md) - -# [Submit a request to change a specific translation](https://github.com/R3voA3/3den-Enhanced/issues/new?assignees=&labels=translation&template=translation_correction.yml) \ No newline at end of file +# See Also +1. [Translation Stats](https://github.com/RevoArma3/3den-Enhanced/blob/master/TRANSLATIONSTATS.md) +2. [Submit a request to change a specific translation](https://github.com/R3voA3/3den-Enhanced/issues/new?assignees=&labels=translation&template=translation_correction.yml) \ No newline at end of file diff --git a/addons/main/attributesObject/eventHandlers.hpp b/addons/main/attributesObject/eventHandlers.hpp index 4b5c43be..3d90cf4c 100644 --- a/addons/main/attributesObject/eventHandlers.hpp +++ b/addons/main/attributesObject/eventHandlers.hpp @@ -6,7 +6,7 @@ class ENH_EventHandlers { class ENH_EventHandlers_Subcategory { - description = "$STR_ENH_OBJECT_ATTRIBUTES_EVENT_HANDLERS"; + description = "$STR_ENH_MAIN_OBJECT_ATTRIBUTES_EVENT_HANDLERS"; data = "AttributeSystemSubcategory"; control = "ENH_SubCategoryNoHeader1_Fixed"; }; diff --git a/addons/main/stringtable.xml b/addons/main/stringtable.xml index 61471c19..11c6723f 100644 --- a/addons/main/stringtable.xml +++ b/addons/main/stringtable.xml @@ -10166,7 +10166,7 @@ Alinear con X+ Aligner sur X+ - + Event Handlers are triggered upon certain events. The event handler is added where the entity is local. Event parameters are passed to it via the <t colorLink='#e69710'><a href='https://community.bistudio.com/wiki/Magic_Variables#this'>_this</a> variable. See <t colorLink='#e69710'><a href='https://community.bistudio.com/wiki/Arma_3:_Event_Handlers'>Arma 3 - Event Handlers</a> and <t colorLink='#e69710'><a href='https://community.bistudio.com/wiki/addEventHandler'>addEventHandler</a> for more information. Event-Handler werden zu bestimmten Ereignissen ausgelöst. Der Event-Handler wird dort hinzugefügt wo die Entität lokal ist. Ereignisparamter stehen in <t colorLink='#e69710'><a href='https://community.bistudio.com/wiki/Magic_Variables#this'>_this</a> Variable zur Verfügung. Mehr Informationen findest du auf <t colorLink='#e69710'><a href='https://community.bistudio.com/wiki/Arma_3:_Event_Handlers'>Arma 3 - Event Handlers</a> and <t colorLink='#e69710'><a href='https://community.bistudio.com/wiki/addEventHandler'>addEventHandler</a>. diff --git a/tools/check_strings.py b/tools/check_strings.py deleted file mode 100644 index 387d8882..00000000 --- a/tools/check_strings.py +++ /dev/null @@ -1,109 +0,0 @@ - # PabstMirror -# Checks all strings are defined, run with -u to return all unused strings - -import fnmatch -import os -import re -import sys - -def getDefinedStrings(filepath): - # print("getDefinedStrings {0}".format(filepath)) - with open(filepath, 'r', encoding="latin-1") as file: - content = file.read() - srch = re.compile('Key ID\=\"(STR_ENH_[_a-zA-Z0-9]*)"', re.IGNORECASE) - modStrings = srch.findall(content) - modStrings = [s.lower() for s in modStrings] - return modStrings - -def getStringUsage(filepath): - selfmodule = (re.search('(addons)[\W]*([_a-zA-Z0-9]*)', filepath)).group(2) - submodule = (re.search(f'(addons)[\W]*{selfmodule}[\W]*([_a-zA-Z0-9]*)', filepath)).group(2) - # print(f"Checking {filepath} from {selfmodule} ({submodule})") - fileStrings = [] - - with open(filepath, 'r') as file: - content = file.read() - - srch = re.compile('(STR_ENH_[_a-zA-Z0-9]*)', re.IGNORECASE) - fileStrings = srch.findall(content) - - srch = re.compile('[^EB][CL]STRING\(([_a-zA-Z0-9]*)\)', re.IGNORECASE) - modStrings = srch.findall(content) - for localString in modStrings: - fileStrings.append("STR_ENH_{0}_{1}".format(selfmodule, localString)) - - srch = re.compile('E[CL]STRING\(([_a-zA-Z0-9]*),([_a-zA-Z0-9]*)\)') - exStrings = srch.findall(content) - for (exModule, exString) in exStrings: - fileStrings.append("STR_ENH_{0}_{1}".format(exModule, exString)) - - srch = re.compile('SUB[CL]STRING\(([_a-zA-Z0-9]*)\)') - subStrings = srch.findall(content) - for (subString) in subStrings: - fileStrings.append(f"STR_ENH_{submodule}_{subString}") - - srch = re.compile('IGNORE_STRING_WARNING\([\'"]*([_a-zA-Z0-9]*)[\'"]*\)') - ignoreWarnings = srch.findall(content) - - fileStrings = [s.lower() for s in fileStrings] - return [s for s in fileStrings if s not in (i.lower() for i in ignoreWarnings)] - -def main(argv): - print("### check_strings.py {} ###".format(argv)) - sqf_list = [] - xml_list = [] - - allDefinedStrings = [] - allUsedStrings = [] - - for folder in ['addons']: - # Allow running from root directory as well as from inside the tools directory - rootDir = "../" + folder - if (os.path.exists(folder)): - rootDir = folder - - for root, dirnames, filenames in os.walk(rootDir): - for filename in fnmatch.filter(filenames, '*.sqf'): - sqf_list.append(os.path.join(root, filename)) - for filename in fnmatch.filter(filenames, '*.cpp'): - sqf_list.append(os.path.join(root, filename)) - for filename in fnmatch.filter(filenames, '*.hpp'): - sqf_list.append(os.path.join(root, filename)) - for filename in fnmatch.filter(filenames, '*.h'): - sqf_list.append(os.path.join(root, filename)) - - for filename in fnmatch.filter(filenames, '*.xml'): - xml_list.append(os.path.join(root, filename)) - - for filename in xml_list: - allDefinedStrings = allDefinedStrings + getDefinedStrings(filename) - for filename in sqf_list: - allUsedStrings = allUsedStrings + getStringUsage(filename) - - allDefinedStrings = list(sorted(set(allDefinedStrings))) - allUsedStrings = list(sorted(set(allUsedStrings))) - - if ("str_enh_tagging_name" in allUsedStrings): allUsedStrings.remove("str_enh_tagging_name") # Handle tagging macro - - print("-----------") - countUnusedStrings = 0 - countUndefinedStrings = 0 - for s in allDefinedStrings: - if (not (s in allUsedStrings)): - countUnusedStrings = countUnusedStrings + 1; - if ("-u" in argv): - print("String {} defined but not used".format(s)) - print("-----------") - for s in allUsedStrings: - if (not (s in allDefinedStrings)): - print("String {} not defined".format(s)) - countUndefinedStrings = countUndefinedStrings + 1; - print("-----------") - - print("Defined Strings:{0} Used Strings:{1}".format(len(allDefinedStrings),len(allUsedStrings))) - print("Unused Strings:{0} Undefined Strings:{1}".format(countUnusedStrings,countUndefinedStrings)) - - return countUndefinedStrings - -if __name__ == "__main__": - main(sys.argv) \ No newline at end of file