mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-13 09:43:49 +00:00
fix: use dummy translations for custom field labels (#49875)
(cherry picked from commit 9a989a84fb)
# Conflicts:
# erpnext/setup/install.py
# erpnext/setup/setup_wizard/operations/install_fixtures.py
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
import click
|
import click
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
|
||||||
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
||||||
from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to
|
from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to
|
||||||
from frappe.utils import cint
|
from frappe.utils import cint
|
||||||
@@ -12,6 +11,7 @@ from frappe.utils import cint
|
|||||||
import erpnext
|
import erpnext
|
||||||
from erpnext.setup.default_energy_point_rules import get_default_energy_point_rules
|
from erpnext.setup.default_energy_point_rules import get_default_energy_point_rules
|
||||||
from erpnext.setup.doctype.incoterm.incoterm import create_incoterms
|
from erpnext.setup.doctype.incoterm.incoterm import create_incoterms
|
||||||
|
from erpnext.setup.utils import identity as _
|
||||||
|
|
||||||
from .default_success_action import get_default_success_action
|
from .default_success_action import get_default_success_action
|
||||||
|
|
||||||
@@ -193,22 +193,25 @@ def add_company_to_session_defaults():
|
|||||||
|
|
||||||
def add_standard_navbar_items():
|
def add_standard_navbar_items():
|
||||||
navbar_settings = frappe.get_single("Navbar Settings")
|
navbar_settings = frappe.get_single("Navbar Settings")
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
|
=======
|
||||||
|
>>>>>>> 9a989a84fb (fix: use dummy translations for custom field labels (#49875))
|
||||||
erpnext_navbar_items = [
|
erpnext_navbar_items = [
|
||||||
{
|
{
|
||||||
"item_label": "Documentation",
|
"item_label": _("Documentation"),
|
||||||
"item_type": "Route",
|
"item_type": "Route",
|
||||||
"route": "https://docs.erpnext.com/",
|
"route": "https://docs.erpnext.com/",
|
||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_label": "User Forum",
|
"item_label": _("User Forum"),
|
||||||
"item_type": "Route",
|
"item_type": "Route",
|
||||||
"route": "https://discuss.frappe.io",
|
"route": "https://discuss.frappe.io",
|
||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_label": "Frappe School",
|
"item_label": _("Frappe School"),
|
||||||
"item_type": "Route",
|
"item_type": "Route",
|
||||||
"route": "https://frappe.io/school?utm_source=in_app",
|
"route": "https://frappe.io/school?utm_source=in_app",
|
||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ from frappe.utils import cstr, getdate
|
|||||||
|
|
||||||
from erpnext.accounts.doctype.account.account import RootNotEditable
|
from erpnext.accounts.doctype.account.account import RootNotEditable
|
||||||
from erpnext.regional.address_template.setup import set_up_address_templates
|
from erpnext.regional.address_template.setup import set_up_address_templates
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
from erpnext.setup.utils import identity as _
|
||||||
|
>>>>>>> 9a989a84fb (fix: use dummy translations for custom field labels (#49875))
|
||||||
|
|
||||||
|
|
||||||
def read_lines(filename: str) -> list[str]:
|
def read_lines(filename: str) -> list[str]:
|
||||||
@@ -550,7 +554,7 @@ def create_bank_account(args, demo=False):
|
|||||||
return doc
|
return doc
|
||||||
|
|
||||||
except RootNotEditable:
|
except RootNotEditable:
|
||||||
frappe.throw(_("Bank account cannot be named as {0}").format(args.get("bank_account")))
|
frappe.throw(frappe._("Bank account cannot be named as {0}").format(args.get("bank_account")))
|
||||||
except frappe.DuplicateEntryError:
|
except frappe.DuplicateEntryError:
|
||||||
# bank account same as a CoA entry
|
# bank account same as a CoA entry
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -234,3 +234,15 @@ def welcome_email():
|
|||||||
site_name = get_default_company() or "ERPNext"
|
site_name = get_default_company() or "ERPNext"
|
||||||
title = _("Welcome to {0}").format(site_name)
|
title = _("Welcome to {0}").format(site_name)
|
||||||
return title
|
return title
|
||||||
|
|
||||||
|
|
||||||
|
def identity(x, *args, **kwargs):
|
||||||
|
"""Used for redefining the translation function to return the string as is.
|
||||||
|
|
||||||
|
We want to create english records but still mark the strings as translatable.
|
||||||
|
E.g. when the respective DocTypes have 'Translate Link Fields' enabled or
|
||||||
|
we're creating custom fields.
|
||||||
|
|
||||||
|
Use like this: `from erpnext.setup.utils import identity as _`
|
||||||
|
"""
|
||||||
|
return x
|
||||||
|
|||||||
Reference in New Issue
Block a user