"""Robust one-pass i18n: read once, replace all, write once per file.""" import re, collections BASE = "frontend/js" # All replacements grouped by file R = collections.defaultdict(list) def add(f, find, repl): R[f].append((find, repl)) F = f"{BASE}/ui.js" # Create file modal add(F, '

Créer un fichier

', '

${t(\'modal.create_file\')}

') add(F, '', '') add(F, '\n \n \n