Merge pull request #16079 from surajshetty3416/fix-translation-for-included-files
This commit is contained in:
commit
4c2f14f824
1 changed files with 3 additions and 1 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue