From a896895a9e76a68ab055ce7871bb9d181d3fac15 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Sat, 2 Apr 2022 16:56:59 +0530 Subject: [PATCH] fix: bulk fix (~330) missing translations --- .../accounts/doctype/account/account_tree.js | 2 +- .../bank_statement_import.js | 2 +- .../cash_flow_mapping/cash_flow_mapping.py | 5 +- .../currency_exchange_settings.py | 3 +- .../mode_of_payment/mode_of_payment.py | 13 ++-- .../doctype/pos_profile/pos_profile.py | 4 +- .../process_statement_of_accounts.js | 4 +- .../doctype/sales_invoice/sales_invoice.py | 2 +- .../report/balance_sheet/balance_sheet.py | 8 +-- .../budget_variance_report.py | 4 +- .../dimension_wise_accounts_balance_report.py | 2 +- .../inactive_sales_items.py | 2 +- .../payment_period_based_on_invoice_date.py | 6 +- .../doctype/asset_category/asset_category.py | 2 +- .../doctype/asset_movement/asset_movement.py | 13 ++-- .../doctype/asset_repair/asset_repair.js | 2 +- .../asset_value_adjustment.py | 2 +- .../supplier_scorecard/supplier_scorecard.py | 3 +- .../supplier_scorecard_criteria.py | 2 +- .../purchase_order_trends.py | 2 +- .../linkedin_settings/linkedin_settings.js | 2 +- .../social_media_post/social_media_post.js | 2 +- .../first_response_time_for_opportunity.py | 3 +- .../course_scheduling_tool.py | 2 - .../student_group_creation_tool.py | 6 +- .../department_approver.py | 2 +- .../shift_assignment/shift_assignment.py | 4 +- .../hr/doctype/shift_request/shift_request.py | 4 +- .../hr/doctype/staffing_plan/staffing_plan.py | 9 +-- .../doctype/loan_repayment/loan_repayment.py | 4 +- .../maintenance_schedule.py | 2 +- .../maintenance_visit/maintenance_visit.py | 2 +- .../report/bom_explorer/bom_explorer.py | 22 ++++--- .../production_plan_summary.py | 17 +++--- .../work_order_stock_report.py | 29 +++++---- .../employee_benefit_claim.py | 6 +- .../doctype/gratuity_rule/gratuity_rule.js | 2 +- .../doctype/payroll_entry/payroll_entry.js | 2 +- .../salary_payments_based_on_payment_mode.py | 6 +- .../delayed_tasks_summary.py | 24 +++++--- .../doctype/datev_settings/datev_settings.js | 2 +- .../doctype/sales_order/sales_order.js | 2 +- .../customer_acquisition_and_loyalty.py | 2 +- .../customer_credit_balance.py | 2 +- .../item_wise_sales_history.py | 2 +- .../quotation_trends/quotation_trends.py | 2 +- .../sales_order_trends/sales_order_trends.py | 4 +- erpnext/stock/doctype/item/item.py | 2 +- .../material_request/material_request.py | 6 +- erpnext/stock/doctype/pick_list/pick_list.py | 11 ++-- .../stock/doctype/stock_entry/stock_entry.js | 2 +- .../warehouse_capacity_summary.js | 2 +- erpnext/stock/reorder_item.py | 3 +- erpnext/stock/report/bom_search/bom_search.py | 5 +- .../item_variant_details.py | 2 +- .../stock_ledger_invariant_check.py | 61 ++++++++++--------- .../first_response_time_for_issues.py | 5 +- erpnext/utilities/doctype/video/video.js | 2 +- .../youtube_interactions.py | 2 +- 59 files changed, 179 insertions(+), 173 deletions(-) diff --git a/erpnext/accounts/doctype/account/account_tree.js b/erpnext/accounts/doctype/account/account_tree.js index a3ef38465ec..8ae90ceb383 100644 --- a/erpnext/accounts/doctype/account/account_tree.js +++ b/erpnext/accounts/doctype/account/account_tree.js @@ -160,7 +160,7 @@ frappe.treeview_settings["Account"] = { let root_company = treeview.page.fields_dict.root_company.get_value(); if(root_company) { - frappe.throw(__("Please add the account to root level Company - ") + root_company); + frappe.throw(__("Please add the account to root level Company - {0}"), [root_company]); } else { treeview.new_node(); } diff --git a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js index 990d6d9c8d4..a964965c26f 100644 --- a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js +++ b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.js @@ -200,7 +200,7 @@ frappe.ui.form.on("Bank Statement Import", { }) .then((result) => { if (result.length > 0) { - frm.add_custom_button("Report Error", () => { + frm.add_custom_button(__("Report Error"), () => { let fake_xhr = { responseText: JSON.stringify({ exc: result[0].error, diff --git a/erpnext/accounts/doctype/cash_flow_mapping/cash_flow_mapping.py b/erpnext/accounts/doctype/cash_flow_mapping/cash_flow_mapping.py index 3bce4d51c7a..402469fc1c0 100644 --- a/erpnext/accounts/doctype/cash_flow_mapping/cash_flow_mapping.py +++ b/erpnext/accounts/doctype/cash_flow_mapping/cash_flow_mapping.py @@ -3,6 +3,7 @@ import frappe +from frappe import _ from frappe.model.document import Document @@ -16,6 +17,6 @@ class CashFlowMapping(Document): ] if len(checked_fields) > 1: frappe.throw( - frappe._("You can only select a maximum of one option from the list of check boxes."), - title="Error", + _("You can only select a maximum of one option from the list of check boxes."), + title=_("Error"), ) diff --git a/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.py b/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.py index 04a8e8ea92f..edea37dcfd9 100644 --- a/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.py +++ b/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.py @@ -68,9 +68,8 @@ class CurrencyExchangeSettings(Document): str(key.key).format(transaction_date=nowdate(), to_currency="INR", from_currency="USD") ] except Exception: - frappe.throw("Invalid result key. Response: " + response.text) + frappe.throw(_("Invalid result key. Response:") + " " + response.text) if not isinstance(value, (int, float)): frappe.throw(_("Returned exchange rate is neither integer not float.")) self.url = response.url - frappe.msgprint("Exchange rate of USD to INR is " + str(value)) diff --git a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py index d0373021a69..ed35d1e0945 100644 --- a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py +++ b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py @@ -42,12 +42,7 @@ class ModeofPayment(Document): pos_profiles = list(map(lambda x: x[0], pos_profiles)) if pos_profiles: - message = ( - "POS Profile " - + frappe.bold(", ".join(pos_profiles)) - + " contains \ - Mode of Payment " - + frappe.bold(str(self.name)) - + ". Please remove them to disable this mode." - ) - frappe.throw(_(message), title="Not Allowed") + message = _( + "POS Profile {} contains Mode of Payment {}. Please remove them to disable this mode." + ).format(frappe.bold(", ".join(pos_profiles)), frappe.bold(str(self.name))) + frappe.throw(message, title=_("Not Allowed")) diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.py b/erpnext/accounts/doctype/pos_profile/pos_profile.py index 65fd4af3508..e83dc0f11e5 100644 --- a/erpnext/accounts/doctype/pos_profile/pos_profile.py +++ b/erpnext/accounts/doctype/pos_profile/pos_profile.py @@ -61,13 +61,13 @@ class POSProfile(Document): if len(item_groups) != len(set(item_groups)): frappe.throw( - _("Duplicate item group found in the item group table"), title="Duplicate Item Group" + _("Duplicate item group found in the item group table"), title=_("Duplicate Item Group") ) if len(customer_groups) != len(set(customer_groups)): frappe.throw( _("Duplicate customer group found in the cutomer group table"), - title="Duplicate Customer Group", + title=_("Duplicate Customer Group"), ) def validate_payment_methods(self): diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js index 29f2e98e779..7dd77fbb3c7 100644 --- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js +++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js @@ -8,7 +8,7 @@ frappe.ui.form.on('Process Statement Of Accounts', { }, refresh: function(frm){ if(!frm.doc.__islocal) { - frm.add_custom_button('Send Emails',function(){ + frm.add_custom_button(__('Send Emails'), function(){ frappe.call({ method: "erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.send_emails", args: { @@ -24,7 +24,7 @@ frappe.ui.form.on('Process Statement Of Accounts', { } }); }); - frm.add_custom_button('Download',function(){ + frm.add_custom_button(__('Download'), function(){ var url = frappe.urllib.get_full_url( '/api/method/erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.download_statements?' + 'document_name='+encodeURIComponent(frm.doc.name)) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 7d98c22033d..1efd3dca0d3 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -1412,7 +1412,7 @@ class SalesInvoice(SellingController): ) ) else: - frappe.throw(_("Select change amount account"), title="Mandatory Field") + frappe.throw(_("Select change amount account"), title=_("Mandatory Field")) def make_write_off_gl_entry(self, gl_entries): # write off entries, applicable if only pos diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.py b/erpnext/accounts/report/balance_sheet/balance_sheet.py index 7b1e9793266..07552e311c0 100644 --- a/erpnext/accounts/report/balance_sheet/balance_sheet.py +++ b/erpnext/accounts/report/balance_sheet/balance_sheet.py @@ -201,17 +201,17 @@ def get_report_summary( net_provisional_profit_loss += provisional_profit_loss.get(key) return [ - {"value": net_asset, "label": "Total Asset", "datatype": "Currency", "currency": currency}, + {"value": net_asset, "label": _("Total Asset"), "datatype": "Currency", "currency": currency}, { "value": net_liability, - "label": "Total Liability", + "label": _("Total Liability"), "datatype": "Currency", "currency": currency, }, - {"value": net_equity, "label": "Total Equity", "datatype": "Currency", "currency": currency}, + {"value": net_equity, "label": _("Total Equity"), "datatype": "Currency", "currency": currency}, { "value": net_provisional_profit_loss, - "label": "Provisional Profit / Loss (Credit)", + "label": _("Provisional Profit / Loss (Credit)"), "indicator": "Green" if net_provisional_profit_loss > 0 else "Red", "datatype": "Currency", "currency": currency, diff --git a/erpnext/accounts/report/budget_variance_report/budget_variance_report.py b/erpnext/accounts/report/budget_variance_report/budget_variance_report.py index ca341f4993e..7b774ba740b 100644 --- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.py +++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.py @@ -97,8 +97,8 @@ def get_columns(filters): if filters["period"] == "Yearly": labels = [ _("Budget") + " " + str(year[0]), - _("Actual ") + " " + str(year[0]), - _("Variance ") + " " + str(year[0]), + _("Actual") + " " + str(year[0]), + _("Variance") + " " + str(year[0]), ] for label in labels: columns.append( diff --git a/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py b/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py index 8e8465cee9f..ecad9f104fa 100644 --- a/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py +++ b/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py @@ -230,7 +230,7 @@ def get_columns(dimension_list): columns.append( { "fieldname": "total", - "label": "Total", + "label": _("Total"), "fieldtype": "Currency", "options": "currency", "width": 150, diff --git a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py index 8db72de22f3..1a003993aac 100644 --- a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py +++ b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py @@ -29,7 +29,7 @@ def get_columns(): "options": "Item Group", "width": 150, }, - {"fieldname": "item", "fieldtype": "Link", "options": "Item", "label": "Item", "width": 150}, + {"fieldname": "item", "fieldtype": "Link", "options": "Item", "label": _("Item"), "width": 150}, {"fieldname": "item_name", "fieldtype": "Data", "label": _("Item Name"), "width": 150}, { "fieldname": "customer", diff --git a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py index 00f5948a1b6..3f178f4715c 100644 --- a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py +++ b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py @@ -115,9 +115,9 @@ def get_columns(filters): {"fieldname": "credit", "label": _("Credit"), "fieldtype": "Currency", "width": 140}, {"fieldname": "remarks", "label": _("Remarks"), "fieldtype": "Data", "width": 200}, {"fieldname": "age", "label": _("Age"), "fieldtype": "Int", "width": 50}, - {"fieldname": "range1", "label": "0-30", "fieldtype": "Currency", "width": 140}, - {"fieldname": "range2", "label": "30-60", "fieldtype": "Currency", "width": 140}, - {"fieldname": "range3", "label": "60-90", "fieldtype": "Currency", "width": 140}, + {"fieldname": "range1", "label": _("0-30"), "fieldtype": "Currency", "width": 140}, + {"fieldname": "range2", "label": _("30-60"), "fieldtype": "Currency", "width": 140}, + {"fieldname": "range3", "label": _("60-90"), "fieldtype": "Currency", "width": 140}, {"fieldname": "range4", "label": _("90 Above"), "fieldtype": "Currency", "width": 140}, { "fieldname": "delay_in_payment", diff --git a/erpnext/assets/doctype/asset_category/asset_category.py b/erpnext/assets/doctype/asset_category/asset_category.py index 7291daf2b33..a4d2c82845a 100644 --- a/erpnext/assets/doctype/asset_category/asset_category.py +++ b/erpnext/assets/doctype/asset_category/asset_category.py @@ -87,7 +87,7 @@ class AssetCategory(Document): missing_cwip_accounts_for_company.append(get_link_to_form("Company", d.company_name)) if missing_cwip_accounts_for_company: - msg = _("""To enable Capital Work in Progress Accounting, """) + msg = _("""To enable Capital Work in Progress Accounting,""") + " " msg += _("""you must select Capital Work in Progress Account in accounts table""") msg += "

" msg += _("You can also set default CWIP account in Company {}").format( diff --git a/erpnext/assets/doctype/asset_movement/asset_movement.py b/erpnext/assets/doctype/asset_movement/asset_movement.py index e61efadb123..143f215db2e 100644 --- a/erpnext/assets/doctype/asset_movement/asset_movement.py +++ b/erpnext/assets/doctype/asset_movement/asset_movement.py @@ -46,10 +46,9 @@ class AssetMovement(Document): if d.target_location: frappe.throw( _( - "Issuing cannot be done to a location. \ - Please enter employee who has issued Asset {0}" + "Issuing cannot be done to a location. Please enter employee who has issued Asset {0}" ).format(d.asset), - title="Incorrect Movement Purpose", + title=_("Incorrect Movement Purpose"), ) if not d.to_employee: frappe.throw(_("Employee is required while issuing Asset {0}").format(d.asset)) @@ -58,10 +57,9 @@ class AssetMovement(Document): if d.to_employee: frappe.throw( _( - "Transferring cannot be done to an Employee. \ - Please enter location where Asset {0} has to be transferred" + "Transferring cannot be done to an Employee. Please enter location where Asset {0} has to be transferred" ).format(d.asset), - title="Incorrect Movement Purpose", + title=_("Incorrect Movement Purpose"), ) if not d.target_location: frappe.throw(_("Target Location is required while transferring Asset {0}").format(d.asset)) @@ -89,8 +87,7 @@ class AssetMovement(Document): if d.to_employee and d.target_location: frappe.throw( _( - "Asset {0} cannot be received at a location and \ - given to employee in a single movement" + "Asset {0} cannot be received at a location and given to employee in a single movement" ).format(d.asset) ) diff --git a/erpnext/assets/doctype/asset_repair/asset_repair.js b/erpnext/assets/doctype/asset_repair/asset_repair.js index 3fe6b2d0d5d..f5e4e723b44 100644 --- a/erpnext/assets/doctype/asset_repair/asset_repair.js +++ b/erpnext/assets/doctype/asset_repair/asset_repair.js @@ -32,7 +32,7 @@ frappe.ui.form.on('Asset Repair', { refresh: function(frm) { if (frm.doc.docstatus) { - frm.add_custom_button("View General Ledger", function() { + frm.add_custom_button(__("View General Ledger"), function() { frappe.route_options = { "voucher_no": frm.doc.name }; diff --git a/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.py b/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.py index 9953c61a811..20865e8ddc4 100644 --- a/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.py +++ b/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.py @@ -37,7 +37,7 @@ class AssetValueAdjustment(Document): _("Asset Value Adjustment cannot be posted before Asset's purchase date {0}.").format( formatdate(asset_purchase_date) ), - title="Incorrect Date", + title=_("Incorrect Date"), ) def set_difference_amount(self): diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py index 992bc805a55..486bf23e909 100644 --- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py +++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py @@ -213,7 +213,8 @@ def make_all_scorecards(docname): end_date = get_scorecard_date(sc.period, start_date) if scp_count > 0: frappe.msgprint( - _("Created {0} scorecards for {1} between: ").format(scp_count, sc.supplier) + _("Created {0} scorecards for {1} between:").format(scp_count, sc.supplier) + + " " + str(first_start_date) + " - " + str(last_end_date) diff --git a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py index 130adc97d40..ab7d4879c43 100644 --- a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py +++ b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py @@ -80,6 +80,6 @@ def _get_variables(criteria): )[0] my_variables.append(var) except Exception: - frappe.throw(_("Unable to find variable: ") + str(match.group(1)), InvalidFormulaVariable) + frappe.throw(_("Unable to find variable:") + " " + str(match.group(1)), InvalidFormulaVariable) return my_variables diff --git a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.py b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.py index 11a74491a4c..dbdc62e9ec7 100644 --- a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.py +++ b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.py @@ -48,7 +48,7 @@ def get_chart_data(data, conditions, filters): "data": { "labels": labels, "datasets": [ - {"name": _("{0}").format(filters.get("period")) + _(" Purchase Value"), "values": datapoints} + {"name": _(filters.get("period")) + " " + _("Purchase Value"), "values": datapoints} ], }, "type": "line", diff --git a/erpnext/crm/doctype/linkedin_settings/linkedin_settings.js b/erpnext/crm/doctype/linkedin_settings/linkedin_settings.js index 7aa0b777596..d532236b7d2 100644 --- a/erpnext/crm/doctype/linkedin_settings/linkedin_settings.js +++ b/erpnext/crm/doctype/linkedin_settings/linkedin_settings.js @@ -37,7 +37,7 @@ frappe.ui.form.on('LinkedIn Settings', { let msg,color; if (days>0){ - msg = __("Your Session will be expire in ") + days + __(" days."); + msg = __("Your Session will be expire in {0} days.", [days]); color = "green"; } else { diff --git a/erpnext/crm/doctype/social_media_post/social_media_post.js b/erpnext/crm/doctype/social_media_post/social_media_post.js index 6874caac71f..d4ac0bad16c 100644 --- a/erpnext/crm/doctype/social_media_post/social_media_post.js +++ b/erpnext/crm/doctype/social_media_post/social_media_post.js @@ -86,7 +86,7 @@ frappe.ui.form.on('Social Media Post', { frm.trigger('add_post_btn'); } if (frm.doc.post_status !='Deleted') { - frm.add_custom_button(('Delete Post'), function() { + frm.add_custom_button(__('Delete Post'), function() { frappe.confirm(__('Are you sure want to delete the Post from Social Media platforms?'), function() { frappe.call({ diff --git a/erpnext/crm/report/first_response_time_for_opportunity/first_response_time_for_opportunity.py b/erpnext/crm/report/first_response_time_for_opportunity/first_response_time_for_opportunity.py index 9dae1d50f68..db36581cecd 100644 --- a/erpnext/crm/report/first_response_time_for_opportunity/first_response_time_for_opportunity.py +++ b/erpnext/crm/report/first_response_time_for_opportunity/first_response_time_for_opportunity.py @@ -3,11 +3,12 @@ import frappe +from frappe import _ def execute(filters=None): columns = [ - {"fieldname": "creation_date", "label": "Date", "fieldtype": "Date", "width": 300}, + {"fieldname": "creation_date", "label": _("Date"), "fieldtype": "Date", "width": 300}, { "fieldname": "first_response_time", "fieldtype": "Duration", diff --git a/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.py b/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.py index 4db6f981fca..b3072c20b6c 100644 --- a/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.py +++ b/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.py @@ -41,10 +41,8 @@ class CourseSchedulingTool(Document): if self.day == calendar.day_name[getdate(date).weekday()]: course_schedule = self.make_course_schedule(date) try: - print("pass") course_schedule.save() except OverlapError: - print("fail") course_schedules_errors.append(date) else: course_schedules.append(course_schedule) diff --git a/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.py b/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.py index 0fb255077f1..bbeb654bfc4 100644 --- a/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.py +++ b/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.py @@ -69,13 +69,13 @@ class StudentGroupCreationTool(Document): l = len(self.courses) for d in self.courses: if not d.student_group_name: - frappe.throw(_("""Student Group Name is mandatory in row {0}""".format(d.idx))) + frappe.throw(_("Student Group Name is mandatory in row {0}").format(d.idx)) if d.group_based_on == "Course" and not d.course: - frappe.throw(_("""Course is mandatory in row {0}""".format(d.idx))) + frappe.throw(_("Course is mandatory in row {0}").format(d.idx)) if d.group_based_on == "Batch" and not d.batch: - frappe.throw(_("""Batch is mandatory in row {0}""".format(d.idx))) + frappe.throw(_("Batch is mandatory in row {0}").format(d.idx)) frappe.publish_realtime( "student_group_creation_progress", {"progress": [d.idx, l]}, user=frappe.session.user diff --git a/erpnext/hr/doctype/department_approver/department_approver.py b/erpnext/hr/doctype/department_approver/department_approver.py index d849900ef2d..87bdddd6ff2 100644 --- a/erpnext/hr/doctype/department_approver/department_approver.py +++ b/erpnext/hr/doctype/department_approver/department_approver.py @@ -87,7 +87,7 @@ def get_approvers(doctype, txt, searchfield, start, page_len, filters): field_name, frappe.bold(employee.employee_name) ) if department_list: - error_msg += _(" or for Department: {0}").format(frappe.bold(employee_department)) + error_msg += " " + _("or for Department: {0}").format(frappe.bold(employee_department)) frappe.throw(error_msg, title=_(field_name + " Missing")) return set(tuple(approver) for approver in approvers) diff --git a/erpnext/hr/doctype/shift_assignment/shift_assignment.py b/erpnext/hr/doctype/shift_assignment/shift_assignment.py index 5a1248698c2..f6bd15951d3 100644 --- a/erpnext/hr/doctype/shift_assignment/shift_assignment.py +++ b/erpnext/hr/doctype/shift_assignment/shift_assignment.py @@ -73,10 +73,10 @@ class ShiftAssignment(Document): frappe.bold(self.employee), frappe.bold(self.shift_type), frappe.bold(shift_details.name) ) if shift_details.start_date: - msg += _(" from {0}").format(getdate(self.start_date).strftime("%d-%m-%Y")) + msg += " " + _("from {0}").format(getdate(self.start_date).strftime("%d-%m-%Y")) title = "Ongoing Shift" if shift_details.end_date: - msg += _(" to {0}").format(getdate(self.end_date).strftime("%d-%m-%Y")) + msg += " " + _("to {0}").format(getdate(self.end_date).strftime("%d-%m-%Y")) title = "Active Shift" if msg: frappe.throw(msg, title=title) diff --git a/erpnext/hr/doctype/shift_request/shift_request.py b/erpnext/hr/doctype/shift_request/shift_request.py index 1e3e8ff6464..b5beef7a99e 100644 --- a/erpnext/hr/doctype/shift_request/shift_request.py +++ b/erpnext/hr/doctype/shift_request/shift_request.py @@ -109,7 +109,7 @@ class ShiftRequest(Document): self.throw_overlap_error(date_overlap) def throw_overlap_error(self, d): - msg = _("Employee {0} has already applied for {1} between {2} and {3} : ").format( + msg = _("Employee {0} has already applied for {1} between {2} and {3}").format( self.employee, d["shift_type"], formatdate(d["from_date"]), formatdate(d["to_date"]) - ) + """ {0}""".format(d["name"]) + ) + """ : {0}""".format(d["name"]) frappe.throw(msg, OverlapError) diff --git a/erpnext/hr/doctype/staffing_plan/staffing_plan.py b/erpnext/hr/doctype/staffing_plan/staffing_plan.py index 93a493c9d25..ce7e50f7f4a 100644 --- a/erpnext/hr/doctype/staffing_plan/staffing_plan.py +++ b/erpnext/hr/doctype/staffing_plan/staffing_plan.py @@ -91,8 +91,7 @@ class StaffingPlan(Document): ) > flt(parent_plan_details[0].total_estimated_cost): frappe.throw( _( - "You can only plan for upto {0} vacancies and budget {1} \ - for {2} as per staffing plan {3} for parent company {4}." + "You can only plan for upto {0} vacancies and budget {1} for {2} as per staffing plan {3} for parent company {4}." ).format( cint(parent_plan_details[0].vacancies), parent_plan_details[0].total_estimated_cost, @@ -128,8 +127,7 @@ class StaffingPlan(Document): ): frappe.throw( _( - "{0} vacancies and {1} budget for {2} already planned for subsidiary companies of {3}. \ - You can only plan for upto {4} vacancies and and budget {5} as per staffing plan {6} for parent company {3}." + "{0} vacancies and {1} budget for {2} already planned for subsidiary companies of {3}. You can only plan for upto {4} vacancies and and budget {5} as per staffing plan {6} for parent company {3}." ).format( cint(all_sibling_details.vacancies), all_sibling_details.total_estimated_cost, @@ -162,8 +160,7 @@ class StaffingPlan(Document): ): frappe.throw( _( - "Subsidiary companies have already planned for {1} vacancies at a budget of {2}. \ - Staffing Plan for {0} should allocate more vacancies and budget for {3} than planned for its subsidiary companies" + "Subsidiary companies have already planned for {1} vacancies at a budget of {2}. Staffing Plan for {0} should allocate more vacancies and budget for {3} than planned for its subsidiary companies" ).format( self.company, cint(children_details.vacancies), diff --git a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py index 9033a3ac416..304d1a75c9a 100644 --- a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py +++ b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py @@ -387,13 +387,13 @@ class LoanRepayment(AccountsController): gle_map = [] if self.shortfall_amount and self.amount_paid > self.shortfall_amount: - remarks = _("Shortfall Repayment of {0}.\nRepayment against Loan: {1}").format( + remarks = _("Shortfall Repayment of {0}.
Repayment against Loan: {1}").format( self.shortfall_amount, self.against_loan ) elif self.shortfall_amount: remarks = _("Shortfall Repayment of {0}").format(self.shortfall_amount) else: - remarks = _("Repayment against Loan: ") + self.against_loan + remarks = _("Repayment against Loan:") + " " + self.against_loan if self.repay_from_salary: payment_account = self.payroll_payable_account diff --git a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py index 256f66071f3..9a23c071061 100644 --- a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py @@ -250,7 +250,7 @@ class MaintenanceSchedule(TransactionBase): _("Serial No {0} does not belong to Item {1}").format( frappe.bold(serial_no), frappe.bold(item_code) ), - title="Invalid", + title=_("Invalid"), ) if sr_details.warranty_expiry_date and getdate(sr_details.warranty_expiry_date) >= getdate( diff --git a/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.py b/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.py index 29a17849fd9..66f4426a0b8 100644 --- a/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.py +++ b/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.py @@ -20,7 +20,7 @@ class MaintenanceVisit(TransactionBase): def validate_purpose_table(self): if not self.purposes: - frappe.throw(_("Add Items in the Purpose Table"), title="Purposes Required") + frappe.throw(_("Add Items in the Purpose Table"), title=_("Purposes Required")) def validate_maintenance_date(self): if self.maintenance_type == "Scheduled" and self.maintenance_schedule_detail: diff --git a/erpnext/manufacturing/report/bom_explorer/bom_explorer.py b/erpnext/manufacturing/report/bom_explorer/bom_explorer.py index c0affd9cada..ac2f61c5de6 100644 --- a/erpnext/manufacturing/report/bom_explorer/bom_explorer.py +++ b/erpnext/manufacturing/report/bom_explorer/bom_explorer.py @@ -3,6 +3,7 @@ import frappe +from frappe import _ def execute(filters=None): @@ -46,17 +47,22 @@ def get_exploded_items(bom, data, indent=0, qty=1): def get_columns(): return [ { - "label": "Item Code", + "label": _("Item Code"), "fieldtype": "Link", "fieldname": "item_code", "width": 300, "options": "Item", }, - {"label": "Item Name", "fieldtype": "data", "fieldname": "item_name", "width": 100}, - {"label": "BOM", "fieldtype": "Link", "fieldname": "bom", "width": 150, "options": "BOM"}, - {"label": "Qty", "fieldtype": "data", "fieldname": "qty", "width": 100}, - {"label": "UOM", "fieldtype": "data", "fieldname": "uom", "width": 100}, - {"label": "BOM Level", "fieldtype": "Int", "fieldname": "bom_level", "width": 100}, - {"label": "Standard Description", "fieldtype": "data", "fieldname": "description", "width": 150}, - {"label": "Scrap", "fieldtype": "data", "fieldname": "scrap", "width": 100}, + {"label": _("Item Name"), "fieldtype": "data", "fieldname": "item_name", "width": 100}, + {"label": _("BOM"), "fieldtype": "Link", "fieldname": "bom", "width": 150, "options": "BOM"}, + {"label": _("Qty"), "fieldtype": "data", "fieldname": "qty", "width": 100}, + {"label": _("UOM"), "fieldtype": "data", "fieldname": "uom", "width": 100}, + {"label": _("BOM Level"), "fieldtype": "Int", "fieldname": "bom_level", "width": 100}, + { + "label": _("Standard Description"), + "fieldtype": "data", + "fieldname": "description", + "width": 150, + }, + {"label": _("Scrap"), "fieldtype": "data", "fieldname": "scrap", "width": 100}, ] diff --git a/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.py b/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.py index 17f7f5e51fa..2c8f82f2cc6 100644 --- a/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.py +++ b/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.py @@ -3,6 +3,7 @@ import frappe +from frappe import _ from frappe.utils import flt @@ -114,28 +115,28 @@ def get_purchase_order_details(filters, order_details): def get_column(filters): return [ { - "label": "Finished Good", + "label": _("Finished Good"), "fieldtype": "Link", "fieldname": "item_code", "width": 300, "options": "Item", }, - {"label": "Item Name", "fieldtype": "data", "fieldname": "item_name", "width": 100}, + {"label": _("Item Name"), "fieldtype": "data", "fieldname": "item_name", "width": 100}, { - "label": "Document Type", + "label": _("Document Type"), "fieldtype": "Link", "fieldname": "document_type", "width": 150, "options": "DocType", }, { - "label": "Document Name", + "label": _("Document Name"), "fieldtype": "Dynamic Link", "fieldname": "document_name", "width": 150, }, - {"label": "BOM Level", "fieldtype": "Int", "fieldname": "bom_level", "width": 100}, - {"label": "Order Qty", "fieldtype": "Float", "fieldname": "qty", "width": 120}, - {"label": "Received Qty", "fieldtype": "Float", "fieldname": "produced_qty", "width": 160}, - {"label": "Pending Qty", "fieldtype": "Float", "fieldname": "pending_qty", "width": 110}, + {"label": _("BOM Level"), "fieldtype": "Int", "fieldname": "bom_level", "width": 100}, + {"label": _("Order Qty"), "fieldtype": "Float", "fieldname": "qty", "width": 120}, + {"label": _("Received Qty"), "fieldtype": "Float", "fieldname": "produced_qty", "width": 160}, + {"label": _("Pending Qty"), "fieldtype": "Float", "fieldname": "pending_qty", "width": 110}, ] diff --git a/erpnext/manufacturing/report/work_order_stock_report/work_order_stock_report.py b/erpnext/manufacturing/report/work_order_stock_report/work_order_stock_report.py index c6b7e58d656..063ebba0597 100644 --- a/erpnext/manufacturing/report/work_order_stock_report/work_order_stock_report.py +++ b/erpnext/manufacturing/report/work_order_stock_report/work_order_stock_report.py @@ -3,6 +3,7 @@ import frappe +from frappe import _ from frappe.utils import cint @@ -99,59 +100,65 @@ def get_columns(): columns = [ { "fieldname": "work_order", - "label": "Work Order", + "label": _("Work Order"), "fieldtype": "Link", "options": "Work Order", "width": 110, }, - {"fieldname": "bom_no", "label": "BOM", "fieldtype": "Link", "options": "BOM", "width": 120}, + {"fieldname": "bom_no", "label": _("BOM"), "fieldtype": "Link", "options": "BOM", "width": 120}, { "fieldname": "description", - "label": "Description", + "label": _("Description"), "fieldtype": "Data", "options": "", "width": 230, }, { "fieldname": "item_code", - "label": "Item Code", + "label": _("Item Code"), "fieldtype": "Link", "options": "Item", "width": 110, }, { "fieldname": "source_warehouse", - "label": "Source Warehouse", + "label": _("Source Warehouse"), "fieldtype": "Link", "options": "Warehouse", "width": 110, }, - {"fieldname": "qty", "label": "Qty to Build", "fieldtype": "Data", "options": "", "width": 110}, - {"fieldname": "status", "label": "Status", "fieldtype": "Data", "options": "", "width": 100}, + { + "fieldname": "qty", + "label": _("Qty to Build"), + "fieldtype": "Data", + "options": "", + "width": 110, + }, + {"fieldname": "status", "label": _("Status"), "fieldtype": "Data", "options": "", "width": 100}, { "fieldname": "req_items", - "label": "# Req'd Items", + "label": _("# Req'd Items"), "fieldtype": "Data", "options": "", "width": 105, }, { "fieldname": "instock", - "label": "# In Stock", + "label": _("# In Stock"), "fieldtype": "Data", "options": "", "width": 105, }, { "fieldname": "buildable_qty", - "label": "Buildable Qty", + "label": _("Buildable Qty"), "fieldtype": "Data", "options": "", "width": 100, }, { "fieldname": "ready_to_build", - "label": "Build All?", + "label": _("Build All?"), "fieldtype": "Data", "options": "", "width": 90, diff --git a/erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.py b/erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.py index 31f26b25e73..6ec34b9e71f 100644 --- a/erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.py +++ b/erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.py @@ -44,8 +44,7 @@ class EmployeeBenefitClaim(Document): if max_benefits < claimed_amount: frappe.throw( _( - "Maximum benefit of employee {0} exceeds {1} by the sum {2} of previous claimed\ - amount" + "Maximum benefit of employee {0} exceeds {1} by the sum {2} of previous claimed amount" ).format(self.employee, max_benefits, claimed_amount - max_benefits) ) @@ -84,8 +83,7 @@ class EmployeeBenefitClaim(Document): if max_benefits < pro_rata_amount + claimed_amount: frappe.throw( _( - "Maximum benefit of employee {0} exceeds {1} by the sum {2} of benefit application pro-rata component\ - amount and previous claimed amount" + "Maximum benefit of employee {0} exceeds {1} by the sum {2} of benefit application pro-rata component amount and previous claimed amount" ).format( self.employee, max_benefits, pro_rata_amount + claimed_amount - max_benefits ) diff --git a/erpnext/payroll/doctype/gratuity_rule/gratuity_rule.js b/erpnext/payroll/doctype/gratuity_rule/gratuity_rule.js index 014a121c96a..7290a9eafa3 100644 --- a/erpnext/payroll/doctype/gratuity_rule/gratuity_rule.js +++ b/erpnext/payroll/doctype/gratuity_rule/gratuity_rule.js @@ -34,7 +34,7 @@ frappe.ui.form.on('Gratuity Rule Slab', { to_year(frm, cdt, cdn) { let row = locals[cdt][cdn]; if (row.to_year <= row.from_year && row.to_year === 0) { - frappe.throw(__("To(Year) year can not be less than From(year) ")); + frappe.throw(__("To(Year) year can not be less than From(year)")); } } }); diff --git a/erpnext/payroll/doctype/payroll_entry/payroll_entry.js b/erpnext/payroll/doctype/payroll_entry/payroll_entry.js index 496c37b2fad..62e183e59c7 100644 --- a/erpnext/payroll/doctype/payroll_entry/payroll_entry.js +++ b/erpnext/payroll/doctype/payroll_entry/payroll_entry.js @@ -112,7 +112,7 @@ frappe.ui.form.on('Payroll Entry', { }, callback: function (r) { if (r.message && !r.message.submitted) { - frm.add_custom_button("Make Bank Entry", function () { + frm.add_custom_button(__("Make Bank Entry"), function () { make_bank_entry(frm); }).addClass("btn-primary"); } diff --git a/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.py b/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.py index e5348df8864..4223f9d4fb5 100644 --- a/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.py +++ b/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.py @@ -142,21 +142,21 @@ def get_report_summary(gross_pay, total_deductions, net_pay, currency): return [ { "value": gross_pay, - "label": "Total Gross Pay", + "label": _("Total Gross Pay"), "indicator": "Green", "datatype": "Currency", "currency": currency, }, { "value": total_deductions, - "label": "Total Deduction", + "label": _("Total Deduction"), "datatype": "Currency", "indicator": "Red", "currency": currency, }, { "value": net_pay, - "label": "Total Net Pay", + "label": _("Total Net Pay"), "datatype": "Currency", "indicator": "Blue", "currency": currency, diff --git a/erpnext/projects/report/delayed_tasks_summary/delayed_tasks_summary.py b/erpnext/projects/report/delayed_tasks_summary/delayed_tasks_summary.py index 5c3dc2da118..17e3155e286 100644 --- a/erpnext/projects/report/delayed_tasks_summary/delayed_tasks_summary.py +++ b/erpnext/projects/report/delayed_tasks_summary/delayed_tasks_summary.py @@ -3,6 +3,7 @@ import frappe +from frappe import _ from frappe.utils import date_diff, nowdate @@ -83,19 +84,24 @@ def get_chart_data(data): def get_columns(): columns = [ - {"fieldname": "name", "fieldtype": "Link", "label": "Task", "options": "Task", "width": 150}, - {"fieldname": "subject", "fieldtype": "Data", "label": "Subject", "width": 200}, - {"fieldname": "status", "fieldtype": "Data", "label": "Status", "width": 100}, - {"fieldname": "priority", "fieldtype": "Data", "label": "Priority", "width": 80}, - {"fieldname": "progress", "fieldtype": "Data", "label": "Progress (%)", "width": 120}, + {"fieldname": "name", "fieldtype": "Link", "label": _("Task"), "options": "Task", "width": 150}, + {"fieldname": "subject", "fieldtype": "Data", "label": _("Subject"), "width": 200}, + {"fieldname": "status", "fieldtype": "Data", "label": _("Status"), "width": 100}, + {"fieldname": "priority", "fieldtype": "Data", "label": _("Priority"), "width": 80}, + {"fieldname": "progress", "fieldtype": "Data", "label": _("Progress (%)"), "width": 120}, { "fieldname": "exp_start_date", "fieldtype": "Date", - "label": "Expected Start Date", + "label": _("Expected Start Date"), "width": 150, }, - {"fieldname": "exp_end_date", "fieldtype": "Date", "label": "Expected End Date", "width": 150}, - {"fieldname": "completed_on", "fieldtype": "Date", "label": "Actual End Date", "width": 130}, - {"fieldname": "delay", "fieldtype": "Data", "label": "Delay (In Days)", "width": 120}, + { + "fieldname": "exp_end_date", + "fieldtype": "Date", + "label": _("Expected End Date"), + "width": 150, + }, + {"fieldname": "completed_on", "fieldtype": "Date", "label": _("Actual End Date"), "width": 130}, + {"fieldname": "delay", "fieldtype": "Data", "label": _("Delay (In Days)"), "width": 120}, ] return columns diff --git a/erpnext/regional/doctype/datev_settings/datev_settings.js b/erpnext/regional/doctype/datev_settings/datev_settings.js index f04705929fc..3c365494c49 100644 --- a/erpnext/regional/doctype/datev_settings/datev_settings.js +++ b/erpnext/regional/doctype/datev_settings/datev_settings.js @@ -3,6 +3,6 @@ frappe.ui.form.on('DATEV Settings', { refresh: function(frm) { - frm.add_custom_button('Show Report', () => frappe.set_route('query-report', 'DATEV'), "fa fa-table"); + frm.add_custom_button(__('Show Report'), () => frappe.set_route('query-report', 'DATEV'), "fa fa-table"); } }); diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 87f277f65c8..0b48f70eab6 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -727,7 +727,7 @@ erpnext.selling.SalesOrderController = class SalesOrderController extends erpnex args: { reference_doctype: me.frm.doctype, reference_name: me.frm.docname, - content: __('Reason for hold: ')+data.reason_for_hold, + content: __('Reason for hold:') + ' ' + data.reason_for_hold, comment_email: frappe.session.user, comment_by: frappe.session.user_fullname }, diff --git a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py index 33badc37f8a..3e4bfb2ef71 100644 --- a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py +++ b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py @@ -102,7 +102,7 @@ def get_data_by_time(filters, common_columns): def get_data_by_territory(filters, common_columns): columns = [ { - "label": "Territory", + "label": _("Territory"), "fieldname": "territory", "fieldtype": "Link", "options": "Territory", diff --git a/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py index 1c10a374b6f..98633cb7198 100644 --- a/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py +++ b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py @@ -65,7 +65,7 @@ def get_columns(customer_naming_type): _("Credit Limit") + ":Currency:120", _("Outstanding Amt") + ":Currency:100", _("Credit Balance") + ":Currency:120", - _("Bypass credit check at Sales Order ") + ":Check:80", + _("Bypass credit check at Sales Order") + ":Check:80", _("Is Frozen") + ":Check:80", _("Disabled") + ":Check:80", ] diff --git a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py index 12ca7b3ff83..091c20c917f 100644 --- a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py +++ b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py @@ -235,7 +235,7 @@ def get_chart_data(data): return { "data": { "labels": labels[:30], # show max of 30 items in chart - "datasets": [{"name": _(" Total Sales Amount"), "values": datapoints[:30]}], + "datasets": [{"name": _("Total Sales Amount"), "values": datapoints[:30]}], }, "type": "bar", } diff --git a/erpnext/selling/report/quotation_trends/quotation_trends.py b/erpnext/selling/report/quotation_trends/quotation_trends.py index dfcec22cca2..4e0758d7cda 100644 --- a/erpnext/selling/report/quotation_trends/quotation_trends.py +++ b/erpnext/selling/report/quotation_trends/quotation_trends.py @@ -49,7 +49,7 @@ def get_chart_data(data, conditions, filters): "data": { "labels": labels, "datasets": [ - {"name": _("{0}").format(filters.get("period")) + _(" Quoted Amount"), "values": datapoints} + {"name": _(filters.get("period")) + " " + _("Quoted Amount"), "values": datapoints} ], }, "type": "line", diff --git a/erpnext/selling/report/sales_order_trends/sales_order_trends.py b/erpnext/selling/report/sales_order_trends/sales_order_trends.py index 93707bd46d9..719f1c52745 100644 --- a/erpnext/selling/report/sales_order_trends/sales_order_trends.py +++ b/erpnext/selling/report/sales_order_trends/sales_order_trends.py @@ -47,9 +47,7 @@ def get_chart_data(data, conditions, filters): return { "data": { "labels": labels, - "datasets": [ - {"name": _("{0}").format(filters.get("period")) + _(" Sales Value"), "values": datapoints} - ], + "datasets": [{"name": _(filters.get("period")) + " " + _("Sales Value"), "values": datapoints}], }, "type": "line", "lineOptions": {"regionFill": 1}, diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 9d7c22fc8e6..535f5652096 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -464,7 +464,7 @@ class Item(Document): frappe.msgprint( _("It can take upto few hours for accurate stock values to be visible after merging items."), indicator="orange", - title="Note", + title=_("Note"), ) if self.published_in_website: diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 4524914f5c4..a70ff171a9b 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -209,16 +209,14 @@ class MaterialRequest(BuyingController): if d.ordered_qty and d.ordered_qty > allowed_qty: frappe.throw( _( - "The total Issue / Transfer quantity {0} in Material Request {1} \ - cannot be greater than allowed requested quantity {2} for Item {3}" + "The total Issue / Transfer quantity {0} in Material Request {1} cannot be greater than allowed requested quantity {2} for Item {3}" ).format(d.ordered_qty, d.parent, allowed_qty, d.item_code) ) elif d.ordered_qty and d.ordered_qty > d.stock_qty: frappe.throw( _( - "The total Issue / Transfer quantity {0} in Material Request {1} \ - cannot be greater than requested quantity {2} for Item {3}" + "The total Issue / Transfer quantity {0} in Material Request {1} cannot be greater than requested quantity {2} for Item {3}" ).format(d.ordered_qty, d.parent, d.qty, d.item_code) ) diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py index d3476a88f05..33d7745c628 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.py +++ b/erpnext/stock/doctype/pick_list/pick_list.py @@ -33,7 +33,9 @@ class PickList(Document): location.sales_order and frappe.db.get_value("Sales Order", location.sales_order, "per_picked") == 100 ): - frappe.throw("Row " + str(location.idx) + " has been picked already!") + frappe.throw( + _("Row #{}: item {} has been picked already.").format(location.idx, location.item_code) + ) def before_submit(self): for item in self.locations: @@ -82,10 +84,9 @@ class PickList(Document): 100 + flt(frappe.db.get_single_value("Stock Settings", "over_delivery_receipt_allowance")) ): frappe.throw( - "You are picking more than required quantity for " - + item_code - + ". Check if there is any other pick list created for " - + so_doc.name + _( + "You are picking more than required quantity for {}. Check if there is any other pick list created for {}" + ).format(item_code, so_doc.name) ) frappe.db.set_value("Sales Order Item", so_item, "picked_qty", already_picked + picked_qty) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 7564bb266d7..f9baeb8e76a 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -214,7 +214,7 @@ frappe.ui.form.on('Stock Entry', { if (frm.doc.docstatus === 1) { if (frm.doc.add_to_transit && frm.doc.purpose=='Material Transfer' && frm.doc.per_transferred < 100) { - frm.add_custom_button('End Transit', function() { + frm.add_custom_button(__('End Transit'), function() { frappe.model.open_mapped_doc({ method: "erpnext.stock.doctype.stock_entry.stock_entry.make_stock_in_entry", frm: frm diff --git a/erpnext/stock/page/warehouse_capacity_summary/warehouse_capacity_summary.js b/erpnext/stock/page/warehouse_capacity_summary/warehouse_capacity_summary.js index ea27dd251da..61927f51a82 100644 --- a/erpnext/stock/page/warehouse_capacity_summary/warehouse_capacity_summary.js +++ b/erpnext/stock/page/warehouse_capacity_summary/warehouse_capacity_summary.js @@ -68,7 +68,7 @@ frappe.pages['warehouse-capacity-summary'].on_page_load = function(wrapper) { options: [ {fieldname: 'stock_capacity', label: __('Capacity (Stock UOM)')}, {fieldname: 'percent_occupied', label: __('% Occupied')}, - {fieldname: 'actual_qty', label: __('Balance Qty (Stock ')} + {fieldname: 'actual_qty', label: __('Balance Qty (Stock)')} ] }, change: function(sort_by, sort_order) { diff --git a/erpnext/stock/reorder_item.py b/erpnext/stock/reorder_item.py index a96ffefd474..ee151b7517c 100644 --- a/erpnext/stock/reorder_item.py +++ b/erpnext/stock/reorder_item.py @@ -246,8 +246,7 @@ def notify_errors(exceptions_list): _("Dear System Manager,") + "
" + _( - "An error occured for certain Items while creating Material Requests based on Re-order level. \ - Please rectify these issues :" + "An error occured for certain Items while creating Material Requests based on Re-order level. Please rectify these issues :" ) + "
" ) diff --git a/erpnext/stock/report/bom_search/bom_search.py b/erpnext/stock/report/bom_search/bom_search.py index 3be87abc393..56a65c3c308 100644 --- a/erpnext/stock/report/bom_search/bom_search.py +++ b/erpnext/stock/report/bom_search/bom_search.py @@ -3,6 +3,7 @@ import frappe +from frappe import _ def execute(filters=None): @@ -34,10 +35,10 @@ def execute(filters=None): return [ { "fieldname": "parent", - "label": "BOM", + "label": _("BOM"), "width": 200, "fieldtype": "Dynamic Link", "options": "doctype", }, - {"fieldname": "doctype", "label": "Type", "width": 200, "fieldtype": "Data"}, + {"fieldname": "doctype", "label": _("Type"), "width": 200, "fieldtype": "Data"}, ], data diff --git a/erpnext/stock/report/item_variant_details/item_variant_details.py b/erpnext/stock/report/item_variant_details/item_variant_details.py index d1bf2203f17..e3a2a65d8fe 100644 --- a/erpnext/stock/report/item_variant_details/item_variant_details.py +++ b/erpnext/stock/report/item_variant_details/item_variant_details.py @@ -71,7 +71,7 @@ def get_columns(item): columns = [ { "fieldname": "variant_name", - "label": "Variant", + "label": _("Variant"), "fieldtype": "Link", "options": "Item", "width": 200, diff --git a/erpnext/stock/report/stock_ledger_invariant_check/stock_ledger_invariant_check.py b/erpnext/stock/report/stock_ledger_invariant_check/stock_ledger_invariant_check.py index 6cc9061685f..837c4a6d15c 100644 --- a/erpnext/stock/report/stock_ledger_invariant_check/stock_ledger_invariant_check.py +++ b/erpnext/stock/report/stock_ledger_invariant_check/stock_ledger_invariant_check.py @@ -4,6 +4,7 @@ import json import frappe +from frappe import _ SLE_FIELDS = ( "name", @@ -105,155 +106,155 @@ def get_columns(): { "fieldname": "name", "fieldtype": "Link", - "label": "Stock Ledger Entry", + "label": _("Stock Ledger Entry"), "options": "Stock Ledger Entry", }, { "fieldname": "posting_date", "fieldtype": "Date", - "label": "Posting Date", + "label": _("Posting Date"), }, { "fieldname": "posting_time", "fieldtype": "Time", - "label": "Posting Time", + "label": _("Posting Time"), }, { "fieldname": "creation", "fieldtype": "Datetime", - "label": "Creation", + "label": _("Creation"), }, { "fieldname": "voucher_type", "fieldtype": "Link", - "label": "Voucher Type", + "label": _("Voucher Type"), "options": "DocType", }, { "fieldname": "voucher_no", "fieldtype": "Dynamic Link", - "label": "Voucher No", + "label": _("Voucher No"), "options": "voucher_type", }, { "fieldname": "batch_no", "fieldtype": "Link", - "label": "Batch", + "label": _("Batch"), "options": "Batch", }, { "fieldname": "use_batchwise_valuation", "fieldtype": "Check", - "label": "Batchwise Valuation", + "label": _("Batchwise Valuation"), }, { "fieldname": "actual_qty", "fieldtype": "Float", - "label": "Qty Change", + "label": _("Qty Change"), }, { "fieldname": "incoming_rate", "fieldtype": "Float", - "label": "Incoming Rate", + "label": _("Incoming Rate"), }, { "fieldname": "consumption_rate", "fieldtype": "Float", - "label": "Consumption Rate", + "label": _("Consumption Rate"), }, { "fieldname": "qty_after_transaction", "fieldtype": "Float", - "label": "(A) Qty After Transaction", + "label": _("(A) Qty After Transaction"), }, { "fieldname": "expected_qty_after_transaction", "fieldtype": "Float", - "label": "(B) Expected Qty After Transaction", + "label": _("(B) Expected Qty After Transaction"), }, { "fieldname": "difference_in_qty", "fieldtype": "Float", - "label": "A - B", + "label": _("A - B"), }, { "fieldname": "stock_queue", "fieldtype": "Data", - "label": "FIFO/LIFO Queue", + "label": _("FIFO/LIFO Queue"), }, { "fieldname": "fifo_queue_qty", "fieldtype": "Float", - "label": "(C) Total qty in queue", + "label": _("(C) Total qty in queue"), }, { "fieldname": "fifo_qty_diff", "fieldtype": "Float", - "label": "A - C", + "label": _("A - C"), }, { "fieldname": "stock_value", "fieldtype": "Float", - "label": "(D) Balance Stock Value", + "label": _("(D) Balance Stock Value"), }, { "fieldname": "fifo_stock_value", "fieldtype": "Float", - "label": "(E) Balance Stock Value in Queue", + "label": _("(E) Balance Stock Value in Queue"), }, { "fieldname": "fifo_value_diff", "fieldtype": "Float", - "label": "D - E", + "label": _("D - E"), }, { "fieldname": "stock_value_difference", "fieldtype": "Float", - "label": "(F) Stock Value Difference", + "label": _("(F) Stock Value Difference"), }, { "fieldname": "stock_value_from_diff", "fieldtype": "Float", - "label": "Balance Stock Value using (F)", + "label": _("Balance Stock Value using (F)"), }, { "fieldname": "diff_value_diff", "fieldtype": "Float", - "label": "K - D", + "label": _("K - D"), }, { "fieldname": "fifo_stock_diff", "fieldtype": "Float", - "label": "(G) Stock Value difference (FIFO queue)", + "label": _("(G) Stock Value difference (FIFO queue)"), }, { "fieldname": "fifo_difference_diff", "fieldtype": "Float", - "label": "F - G", + "label": _("F - G"), }, { "fieldname": "valuation_rate", "fieldtype": "Float", - "label": "(H) Valuation Rate", + "label": _("(H) Valuation Rate"), }, { "fieldname": "fifo_valuation_rate", "fieldtype": "Float", - "label": "(I) Valuation Rate as per FIFO", + "label": _("(I) Valuation Rate as per FIFO"), }, { "fieldname": "fifo_valuation_diff", "fieldtype": "Float", - "label": "H - I", + "label": _("H - I"), }, { "fieldname": "balance_value_by_qty", "fieldtype": "Float", - "label": "(J) Valuation = Value (D) ÷ Qty (A)", + "label": _("(J) Valuation = Value (D) ÷ Qty (A)"), }, { "fieldname": "valuation_diff", "fieldtype": "Float", - "label": "H - J", + "label": _("H - J"), }, ] diff --git a/erpnext/support/report/first_response_time_for_issues/first_response_time_for_issues.py b/erpnext/support/report/first_response_time_for_issues/first_response_time_for_issues.py index 5b51ef81c7b..57fa7bf2b7b 100644 --- a/erpnext/support/report/first_response_time_for_issues/first_response_time_for_issues.py +++ b/erpnext/support/report/first_response_time_for_issues/first_response_time_for_issues.py @@ -3,15 +3,16 @@ import frappe +from frappe import _ def execute(filters=None): columns = [ - {"fieldname": "creation_date", "label": "Date", "fieldtype": "Date", "width": 300}, + {"fieldname": "creation_date", "label": _("Date"), "fieldtype": "Date", "width": 300}, { "fieldname": "first_response_time", "fieldtype": "Duration", - "label": "First Response Time", + "label": _("First Response Time"), "width": 300, }, ] diff --git a/erpnext/utilities/doctype/video/video.js b/erpnext/utilities/doctype/video/video.js index 9cb5a155ade..e6c6efbbb7c 100644 --- a/erpnext/utilities/doctype/video/video.js +++ b/erpnext/utilities/doctype/video/video.js @@ -4,7 +4,7 @@ frappe.ui.form.on('Video', { refresh: function (frm) { frm.events.toggle_youtube_statistics_section(frm); - frm.add_custom_button("Watch Video", () => frappe.help.show_video(frm.doc.url, frm.doc.title)); + frm.add_custom_button(__("Watch Video"), () => frappe.help.show_video(frm.doc.url, frm.doc.title)); }, toggle_youtube_statistics_section: (frm) => { diff --git a/erpnext/utilities/report/youtube_interactions/youtube_interactions.py b/erpnext/utilities/report/youtube_interactions/youtube_interactions.py index a65a75f3621..a2cb4e80cd8 100644 --- a/erpnext/utilities/report/youtube_interactions/youtube_interactions.py +++ b/erpnext/utilities/report/youtube_interactions/youtube_interactions.py @@ -67,7 +67,7 @@ def get_chart_summary_data(data): { "value": total_views, "indicator": "Blue", - "label": "Total Views", + "label": _("Total Views"), "datatype": "Float", } ]