From e8698a98deec2a6ad4930cca3e6bdd2be0d6ada7 Mon Sep 17 00:00:00 2001 From: mahsem <137205921+mahsem@users.noreply.github.com> Date: Sat, 21 Dec 2024 13:17:01 +0100 Subject: [PATCH] fix: add strings and fields to translation --- frappe/desk/page/setup_wizard/setup_wizard.js | 4 ++-- frappe/desk/query_report.py | 10 +++++----- frappe/printing/page/print/print.js | 2 +- .../page/print_format_builder/print_format_builder.js | 2 +- frappe/templates/print_formats/standard_macros.html | 2 +- .../section_with_tabs/section_with_tabs.html | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/frappe/desk/page/setup_wizard/setup_wizard.js b/frappe/desk/page/setup_wizard/setup_wizard.js index 3d4424ee38..0453e7d479 100644 --- a/frappe/desk/page/setup_wizard/setup_wizard.js +++ b/frappe/desk/page/setup_wizard/setup_wizard.js @@ -219,9 +219,9 @@ frappe.setup.SetupWizard = class SetupWizard extends frappe.ui.Slides { ? frappe.last_response.setup_wizard_failure_message : __("Failed to complete setup"); - this.update_setup_message("Could not start up: " + fail_msg); + this.update_setup_message(__("Could not start up: ") + fail_msg); - this.$working_state.find(".title").html("Setup failed"); + this.$working_state.find(".title").html(__("Setup failed")); this.$abort_btn.show(); } diff --git a/frappe/desk/query_report.py b/frappe/desk/query_report.py index 284d47e525..f3086c0b2a 100644 --- a/frappe/desk/query_report.py +++ b/frappe/desk/query_report.py @@ -39,18 +39,18 @@ def get_report_doc(report_name): if not doc.is_permitted(): frappe.throw( - _("You don't have access to Report: {0}").format(report_name), + _("You don't have access to Report: {0}").format(_(report_name)), frappe.PermissionError, ) if not frappe.has_permission(doc.ref_doctype, "report"): frappe.throw( - _("You don't have permission to get a report on: {0}").format(doc.ref_doctype), + _("You don't have permission to get a report on: {0}").format(_(doc.ref_doctype)), frappe.PermissionError, ) if doc.disabled: - frappe.throw(_("Report {0} is disabled").format(report_name)) + frappe.throw(_("Report {0} is disabled").format(_(report_name))) return doc @@ -516,7 +516,7 @@ def add_total_row(result, columns, meta=None, is_tree=False, parent_field=None): @frappe.whitelist() def get_data_for_custom_field(doctype, field, names=None): if not frappe.has_permission(doctype, "read"): - frappe.throw(_("Not Permitted to read {0}").format(doctype), frappe.PermissionError) + frappe.throw(_("Not Permitted to read {0}").format(_(doctype)), frappe.PermissionError) filters = {} if names: @@ -586,7 +586,7 @@ def save_report(reference_report, report_name, columns, filters): "reference_report": reference_report, } ).insert(ignore_permissions=True) - frappe.msgprint(_("{0} saved successfully").format(new_report.name)) + frappe.msgprint(_("{0} saved successfully").format(_(new_report.name))) return new_report.name diff --git a/frappe/printing/page/print/print.js b/frappe/printing/page/print/print.js index 2bdb94c30d..3bb4353c6f 100644 --- a/frappe/printing/page/print/print.js +++ b/frappe/printing/page/print/print.js @@ -58,7 +58,7 @@ frappe.ui.form.PrintView = class { } set_title() { - this.page.set_title(this.frm.docname); + this.page.set_title(__(this.frm.docname)); } setup_toolbar() { diff --git a/frappe/printing/page/print_format_builder/print_format_builder.js b/frappe/printing/page/print_format_builder/print_format_builder.js index 5238d0d556..51f33c0706 100644 --- a/frappe/printing/page/print_format_builder/print_format_builder.js +++ b/frappe/printing/page/print_format_builder/print_format_builder.js @@ -225,7 +225,7 @@ frappe.PrintFormatBuilder = class PrintFormatBuilder { '
{{ _(doc.name) }}\ '; } diff --git a/frappe/templates/print_formats/standard_macros.html b/frappe/templates/print_formats/standard_macros.html index 06abd9d004..a7ae56b3c2 100644 --- a/frappe/templates/print_formats/standard_macros.html +++ b/frappe/templates/print_formats/standard_macros.html @@ -206,7 +206,7 @@ data-fieldname="{{ df.fieldname }}" data-fieldtype="{{ df.fieldtype }}"
{{ _(doc.select_print_heading) or (_(doc.print_heading) if doc.print_heading != None else _(doc.doctype)) }}
{{ _(doc.sub_heading) if doc.sub_heading != None - else doc.name }} + else _(doc.name) }} {% endif %} diff --git a/frappe/website/web_template/section_with_tabs/section_with_tabs.html b/frappe/website/web_template/section_with_tabs/section_with_tabs.html index ff27e4313d..5105e8d00c 100644 --- a/frappe/website/web_template/section_with_tabs/section_with_tabs.html +++ b/frappe/website/web_template/section_with_tabs/section_with_tabs.html @@ -1,9 +1,9 @@ {%- if title -%} -

{{ title }}

+

{{ _(title) }}

{%- endif -%} {%- if subtitle -%} -

{{ subtitle }}

+

{{ _(subtitle) }}

{%- endif -%}
@@ -33,7 +33,7 @@ - {{ tab.title }} + {{ _(tab.title) }} {%- endfor -%}