chore: snapshot before performance optimization

This commit is contained in:
Sepehr Ramezani
2026-04-17 21:14:43 +02:00
parent b6a548acd8
commit 2eceb32fd4
95 changed files with 4357 additions and 1942 deletions

View File

@@ -0,0 +1,47 @@
import json
def update_json(filepath, updates):
with open(filepath, 'r+', encoding='utf-8') as f:
data = json.load(f)
for key, val in updates.items():
keys = key.split('.')
d = data
for k in keys[:-1]:
if k not in d: d[k] = {}
d = d[k]
d[keys[-1]] = val
f.seek(0)
json.dump(data, f, ensure_ascii=False, indent=2)
f.truncate()
fa_updates = {
'sidebar.editLabels': 'ویرایش برچسب‌ها',
'sidebar.edit': 'ویرایش یادداشت',
'labels.confirmDeleteShort': 'تایید؟',
'common.cancel': 'لغو',
'common.delete': 'حذف',
'labels.editLabels': 'ویرایش برچسب‌ها',
'labels.editLabelsDescription': 'برچسب‌های خود را مدیریت کنید',
'labels.newLabelPlaceholder': 'برچسب جدید...',
'labels.loading': 'در حال بارگذاری...',
'labels.noLabelsFound': 'برچسبی یافت نشد',
'labels.changeColor': 'تغییر رنگ',
'labels.deleteTooltip': 'حذف برچسب',
}
fr_updates = {
'labels.confirmDeleteShort': 'Confirmer ?',
'common.cancel': 'Annuler',
'common.delete': 'Supprimer'
}
en_updates = {
'labels.confirmDeleteShort': 'Confirm?',
'common.cancel': 'Cancel',
'common.delete': 'Delete'
}
update_json('locales/fa.json', fa_updates)
update_json('locales/fr.json', fr_updates)
update_json('locales/en.json', en_updates)