27 lines
886 B
Python
27 lines
886 B
Python
import os
|
|
|
|
frontend_dir = r"\\wsl.localhost\Ubuntu\home\ssalemi\Progetti\Rocketscale\org-parking\frontend"
|
|
|
|
targets = [
|
|
("Ufficio", "Gruppo"),
|
|
("Uffici", "Gruppi"),
|
|
("ufficio", "gruppo"),
|
|
("uffici", "gruppi")
|
|
]
|
|
|
|
for root, _, files in os.walk(frontend_dir):
|
|
for filename in files:
|
|
if filename.endswith(".html") or filename.endswith(".js"):
|
|
filepath = os.path.join(root, filename)
|
|
with open(filepath, "r", encoding="utf-8") as f:
|
|
content = f.read()
|
|
original_content = content
|
|
# Replacing case sensitive
|
|
for old, new in targets:
|
|
content = content.replace(old, new)
|
|
|
|
if content != original_content:
|
|
with open(filepath, "w", encoding="utf-8") as f:
|
|
f.write(content)
|
|
print(f"Updated {filepath}")
|