Selaa lähdekoodia

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 vuotta sitten
committed by GitHub
vanhempi
commit
da6800a0dc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 muutettua tiedostoa jossa 2 lisäystä ja 11 poistoa
  1. +2
    -11
      frappe/desk/page/setup_wizard/setup_wizard.py

+ 2
- 11
frappe/desk/page/setup_wizard/setup_wizard.py Näytä tiedosto

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


import json import json
import os


import frappe import frappe
from frappe.geo.country_info import get_country_info 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 import cint, strip
from frappe.utils.password import update_password from frappe.utils.password import update_password


@@ -290,15 +289,7 @@ def load_messages(language):
frappe.clear_cache() frappe.clear_cache()
set_default_language(get_language_code(language)) set_default_language(get_language_code(language))
frappe.db.commit() 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 return frappe.local.lang






Ladataan…
Peruuta
Tallenna