fix_translations.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import json
  2. import os
  3. def fix_translations():
  4. file_path = os.path.join("src", "locales", "translations.json")
  5. with open(file_path, "r", encoding="utf-8") as f:
  6. data = json.load(f)
  7. if "common" not in data: data["common"] = {}
  8. data["common"]["save_continue"] = {
  9. "en": "Save and Continue",
  10. "me": "Sačuvaj i nastavi",
  11. "ru": "Сохранить и продолжить",
  12. "ua": "Зберегти та продовжити"
  13. }
  14. if "profile" not in data: data["profile"] = {}
  15. data["profile"]["complete_title"] = {
  16. "en": "Complete Your Profile",
  17. "me": "Popunite svoj profil",
  18. "ru": "Заполните профиль",
  19. "ua": "Заповніть профіль"
  20. }
  21. data["profile"]["complete_subtitle"] = {
  22. "en": "Please provide your contact information to continue with the order.",
  23. "me": "Molimo unesite svoje kontakt podatke da biste nastavili sa narudžbom.",
  24. "ru": "Пожалуйста, предоставьте контактную информацию, чтобы продолжить оформление заказа.",
  25. "ua": "Будь ласка, надайте контактну інформацію, щоб продовжити оформлення замовлення."
  26. }
  27. with open(file_path, "w", encoding="utf-8") as f:
  28. json.dump(data, f, ensure_ascii=False, indent=2)
  29. print(f"Successfully updated {file_path}")
  30. if __name__ == "__main__":
  31. fix_translations()