import json with open('src/locales/translations.user.json', 'r', encoding='utf-8') as f: for i, line in enumerate(f, 1): if '"home": {' in line: print(f"FOUND home at line {i}: {line.strip()}") if '"index": {' in line: print(f"FOUND index at line {i}: {line.strip()}") if '"hero": {' in line: print(f"FOUND hero at line {i}: {line.strip()}")