소스 검색

perf: send all translations for setup wizard (#18226) (#18227)

Computing all translations is far slower than just sending everything.
This is how boot works too.

(cherry picked from commit 56920e409a)

Co-authored-by: Ankush Menat <ankush@frappe.io>
version-14
mergify[bot] 2 년 전
committed by GitHub
부모
커밋
da6800a0dc
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
1개의 변경된 파일2개의 추가작업 그리고 11개의 파일을 삭제
  1. +2
    -11
      frappe/desk/page/setup_wizard/setup_wizard.py

+ 2
- 11
frappe/desk/page/setup_wizard/setup_wizard.py 파일 보기

@@ -2,11 +2,10 @@
# License: MIT. See LICENSE

import json
import os

import frappe
from frappe.geo.country_info import get_country_info
from frappe.translate import get_dict, send_translations, set_default_language
from frappe.translate import get_messages_for_boot, send_translations, set_default_language
from frappe.utils import cint, strip
from frappe.utils.password import update_password

@@ -290,15 +289,7 @@ def load_messages(language):
frappe.clear_cache()
set_default_language(get_language_code(language))
frappe.db.commit()
m = get_dict("page", "setup-wizard")

for path in frappe.get_hooks("setup_wizard_requires"):
# common folder `assets` served from `sites/`
js_file_path = os.path.abspath(frappe.get_site_path("..", *path.strip("/").split("/")))
m.update(get_dict("jsfile", js_file_path))

m.update(get_dict("boot"))
send_translations(m)
send_translations(get_messages_for_boot())
return frappe.local.lang




불러오는 중...
취소
저장