Skip to content

Commit

Permalink
fix: remove redundant translation (#18775) (#18780)
Browse files Browse the repository at this point in the history
(cherry picked from commit 09d35c7)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
  • Loading branch information
mergify[bot] and barredterra committed Nov 6, 2022
1 parent 2300412 commit a27c42e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 17 deletions.
5 changes: 0 additions & 5 deletions frappe/client.py
Expand Up @@ -333,11 +333,6 @@ def get_js(items):
with open(contentpath) as srcfile:
code = frappe.utils.cstr(srcfile.read())

if frappe.local.lang != "en":
messages = frappe.get_lang_dict("jsfile", contentpath)
messages = json.dumps(messages)
code += f"\n\n$.extend(frappe._messages, {messages})"

out.append(code)

return out
Expand Down
2 changes: 0 additions & 2 deletions frappe/core/page/permission_manager/permission_manager.py
Expand Up @@ -19,7 +19,6 @@
setup_custom_perms,
update_permission_property,
)
from frappe.translate import send_translations
from frappe.utils.user import get_users_with_role as _get_user_with_role

not_allowed_in_permission_manager = ["DocType", "Patch Log", "Module Def", "Transaction Log"]
Expand All @@ -28,7 +27,6 @@
@frappe.whitelist()
def get_roles_and_doctypes():
frappe.only_for("System Manager")
send_translations(frappe.get_lang_dict("doctype", "DocPerm"))

active_domains = frappe.get_active_domains()

Expand Down
5 changes: 0 additions & 5 deletions frappe/desk/desk_page.py
Expand Up @@ -2,7 +2,6 @@
# License: MIT. See LICENSE

import frappe
from frappe.translate import send_translations


@frappe.whitelist()
Expand Down Expand Up @@ -31,10 +30,6 @@ def getpage():
page = frappe.form_dict.get("name")
doc = get(page)

# load translations
if frappe.lang != "en":
send_translations(frappe.get_lang_dict("page", page))

frappe.response.docs.append(doc)


Expand Down
5 changes: 0 additions & 5 deletions frappe/desk/query_report.py
Expand Up @@ -14,7 +14,6 @@
from frappe.modules import get_module_path, scrub
from frappe.monitor import add_data_to_monitor
from frappe.permissions import get_role_permissions
from frappe.translate import send_translations
from frappe.utils import (
cint,
cstr,
Expand Down Expand Up @@ -202,10 +201,6 @@ def get_script(report_name):
if not script:
script = "frappe.query_reports['%s']={}" % report_name

# load translations
if frappe.lang != "en":
send_translations(frappe.get_lang_dict("report", report_name))

return {
"script": render_include(script),
"html_format": html_format,
Expand Down

0 comments on commit a27c42e

Please sign in to comment.