fix: make untranslatable dialog labels and tour titles translatable

Frappe translates these texts when it renders them (`__(df.label)`, `__(title)` in the form tour),
but the POT extractor only collects strings passed to `__()` in JS. These 17 texts appear in no
`main.pot` of ERPNext or Frappe, so no language can translate them. Wrap them in `__()`.

(cherry picked from commit cb910c6b66)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/regional/united_states.js
This commit is contained in:
Mahmoud Abas
2026-10-25 12:02:28 +00:00
committed by Mergify
parent 0d71bb07bf
commit 98e5b3310e
13 changed files with 25 additions and 15 deletions
@@ -1,6 +1,16 @@
frappe.ui.form.on("Accounts Settings", {
refresh: function (frm) {
<<<<<<< HEAD
frm.set_df_property("acc_frozen_upto", "label", "Books Closed Through");
=======
frm.set_df_property("credit_controller", "label", __("Credit Manager"));
},
});
frappe.ui.form.on("Company", {
refresh: function (frm) {
frm.set_df_property("accounts_frozen_till_date", "label", __("Books Closed Through"));
>>>>>>> cb910c6 (fix: make untranslatable dialog labels and tour titles translatable)
frm.set_df_property(
"frozen_accounts_modifier",
"label",
@@ -38,7 +38,7 @@ frappe.ui.form.on("Chart of Accounts Importer", {
options: ["Excel", "CSV"],
},
{
label: "Template Type",
label: __("Template Type"),
fieldname: "template_type",
fieldtype: "Select",
reqd: 1,
@@ -23,14 +23,14 @@ frappe.tour["Buying Settings"] = [
},
{
fieldname: "po_required",
title: "Purchase Order Required for Purchase Invoice & Receipt Creation",
title: __("Purchase Order Required for Purchase Invoice & Receipt Creation"),
description: __(
"If this option is configured 'Yes', ERPNext will prevent you from creating a Purchase Invoice or Receipt without creating a Purchase Order first. This configuration can be overridden for a particular supplier by enabling the 'Allow Purchase Invoice Creation Without Purchase Order' checkbox in the Supplier master."
),
},
{
fieldname: "pr_required",
title: "Purchase Receipt Required for Purchase Invoice Creation",
title: __("Purchase Receipt Required for Purchase Invoice Creation"),
description: __(
"If this option is configured 'Yes', ERPNext will prevent you from creating a Purchase Invoice without creating a Purchase Receipt first. This configuration can be overridden for a particular supplier by enabling the 'Allow Purchase Invoice Creation Without Purchase Receipt' checkbox in the Supplier master."
),
+2 -2
View File
@@ -123,7 +123,7 @@ erpnext.LeadController = class LeadController extends frappe.ui.form.Controller
default: 1,
},
{
label: "Prospect Name",
label: __("Prospect Name"),
fieldname: "prospect_name",
fieldtype: "Data",
default: frm.doc.company_name,
@@ -148,7 +148,7 @@ erpnext.LeadController = class LeadController extends frappe.ui.form.Controller
if (!existing_contact) {
fields.push({
label: "Create Contact",
label: __("Create Contact"),
fieldname: "create_contact",
fieldtype: "Check",
default: "1",
@@ -134,7 +134,7 @@ erpnext.maintenance.MaintenanceSchedule = class MaintenanceSchedule extends frap
},
},
],
primary_action_label: "Create Visit",
primary_action_label: __("Create Visit"),
primary_action(values) {
frappe.call({
method: "erpnext.maintenance.doctype.maintenance_schedule.maintenance_schedule.make_maintenance_visit",
@@ -16,7 +16,7 @@ frappe.ui.form.on("Operation", {
frappe.tour["Operation"] = [
{
fieldname: "__newname",
title: "Operation Name",
title: __("Operation Name"),
description: __("Enter a name for the Operation, for example, Cutting."),
},
{
@@ -84,7 +84,7 @@ frappe.tour["Routing"] = [
},
{
fieldname: "operations",
title: "BOM Operations",
title: __("BOM Operations"),
description: __(
"Enter the Operation, the table will fetch the Operation details like Hourly Rate, Workstation automatically.\n\n After that, set the Operation Time in minutes and the table will calculate the Operation Costs based on the Hourly Rate and Operation Time."
),
@@ -300,7 +300,7 @@ erpnext.accounts.bank_reconciliation.DialogManager = class DialogManager {
{
fieldname: "edit_in_full_page",
fieldtype: "Button",
label: "Edit in Full Page",
label: __("Edit in Full Page"),
click: () => {
this.edit_in_full_page();
},
@@ -50,7 +50,7 @@ erpnext.PointOfSale.PastOrderSummary = class {
title: __("Email Receipt"),
fields: [
{ fieldname: "email_id", fieldtype: "Data", options: "Email", label: "Email ID", reqd: 1 },
{ fieldname: "content", fieldtype: "Small Text", label: "Message (if any)" },
{ fieldname: "content", fieldtype: "Small Text", label: __("Message (if any)") },
],
primary_action: () => {
this.send_email();
@@ -61,7 +61,7 @@ erpnext.PointOfSale.PastOrderSummary = class {
const print_dialog = new frappe.ui.Dialog({
title: __("Print Receipt"),
fields: [{ fieldname: "print", fieldtype: "Data", label: "Print Preview" }],
fields: [{ fieldname: "print", fieldtype: "Data", label: __("Print Preview") }],
primary_action: () => {
this.print_receipt();
},
+1 -1
View File
@@ -125,7 +125,7 @@ frappe.tour["Employee"] = [
},
{
fieldname: "reports_to",
title: "Reports To",
title: __("Reports To"),
description: __(
"Here, you can select a senior of this Employee. Based on this, Organization Chart will be populated."
),
@@ -66,7 +66,7 @@ frappe.tour["Holiday List"] = [
},
{
fieldname: "get_weekly_off_dates",
title: "Add Holidays",
title: __("Add Holidays"),
description: __(
"Click on Add to Holidays. This will populate the holidays table with all the dates that fall on the selected weekly off. Repeat the process for populating the dates for all your weekly holidays"
),
+1 -1
View File
@@ -1064,7 +1064,7 @@ frappe.tour["Item"] = [
},
{
fieldname: "include_item_in_manufacturing",
title: "Include Item in Manufacturing",
title: __("Include Item in Manufacturing"),
description: __(
"This is for raw material Items that'll be used to create finished goods. If the Item is an additional service like 'washing' that'll be used in the BOM, keep this unchecked."
),
@@ -35,7 +35,7 @@ frappe.query_reports["Stock Ledger Invariant Check"] = {
{
fieldname: "show_incorrect_entries",
fieldtype: "Check",
label: "Show Incorrect Entries",
label: __("Show Incorrect Entries"),
default: 0,
},
],