From eaf8327e0daaaf7a38188ee632c14c4547ca0ba6 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Tue, 22 Feb 2022 18:43:16 +0530 Subject: [PATCH] fix: Use correct path of built assets - Get path from bundled_assets --- frappe/translate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frappe/translate.py b/frappe/translate.py index c883e63de3..0a8c6aeaad 100644 --- a/frappe/translate.py +++ b/frappe/translate.py @@ -576,13 +576,15 @@ def get_server_messages(app): def get_messages_from_include_files(app_name=None): """Returns messages from js files included at time of boot like desk.min.js for desk and web""" + from frappe.utils.jinja_globals import bundled_asset messages = [] app_include_js = frappe.get_hooks("app_include_js", app_name=app_name) or [] web_include_js = frappe.get_hooks("web_include_js", app_name=app_name) or [] include_js = app_include_js + web_include_js for js_path in include_js: - relative_path = os.path.join(frappe.local.sites_path, js_path.lstrip('/')) + file_path = bundled_asset(js_path) + relative_path = os.path.join(frappe.local.sites_path, file_path.lstrip('/')) messages_from_file = get_messages_from_file(relative_path) messages.extend(messages_from_file)