fix: add strings and fields to translation

This commit is contained in:
mahsem 2024-12-21 13:17:01 +01:00 committed by GitHub
parent f243aa1942
commit e8698a98de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 13 additions and 13 deletions

View file

@ -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();
}

View file

@ -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

View file

@ -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() {

View file

@ -225,7 +225,7 @@ frappe.PrintFormatBuilder = class PrintFormatBuilder {
'<div class="print-heading">\
<h2><div>' +
__(this.print_format.doc_type) +
'</div><br><small class="sub-heading">{{ doc.name }}</small>\
'</div><br><small class="sub-heading">{{ _(doc.name) }}</small>\
</h2></div>';
}

View file

@ -206,7 +206,7 @@ data-fieldname="{{ df.fieldname }}" data-fieldtype="{{ df.fieldtype }}"
<div>{{ _(doc.select_print_heading) or (_(doc.print_heading) if doc.print_heading != None
else _(doc.doctype)) }}</div>
<small class="sub-heading">{{ _(doc.sub_heading) if doc.sub_heading != None
else doc.name }}</small>
else _(doc.name) }}</small>
</h2>
</div>
{% endif %}

View file

@ -1,9 +1,9 @@
{%- if title -%}
<h2 class="section-title">{{ title }}</h2>
<h2 class="section-title">{{ _(title) }}</h2>
{%- endif -%}
{%- if subtitle -%}
<p class="section-description">{{ subtitle }}</p>
<p class="section-description">{{ _(subtitle) }}</p>
{%- endif -%}
<div class="mt-12">
@ -33,7 +33,7 @@
<a class="nav-link {{ 'active' if first_tab else '' }}" id="{{ tab.buttonid }}" data-toggle="tab"
href="#{{ tab.panelid }}"
role="tab" aria-controls="{{ tab.panelid }}" aria-selected="{{ 'true' if first_tab else 'false' }}">
{{ tab.title }}
{{ _(tab.title) }}
</a>
</li>
{%- endfor -%}