import re import sys def extract_translations_from_View(view_path): """Extract all translation strings from file A""" translations = {} try: with open(view_path, 'r', encoding='utf-8') as file_a: for line_num, line in enumerate(file_a, 1): # Match T["..."] patterns matches = re.findall(r'T\["([^"]*)"\]', line) for match in matches: translations[match] = line_num except FileNotFoundError: print(f"Error: File {view_path} not found") sys.exit(1) except Exception as e: print(f"Error reading file {view_path}: {e}") sys.exit(1) return translations def extract_localizations_from_resource_file(file_b_path): """Extract all translation strings from file B""" translations = set() try: with open(file_b_path, 'r', encoding='utf-8') as file_b: for line in file_b: # Match the pattern in file B match = re.search(r'