diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index 0bcab1ccb59..ccae5136a9e 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -4,14 +4,13 @@ import click import frappe -from frappe import _ 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.utils import cint import erpnext 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.utils import identity as _ from .default_success_action import get_default_success_action @@ -193,28 +192,27 @@ def add_company_to_session_defaults(): def add_standard_navbar_items(): navbar_settings = frappe.get_single("Navbar Settings") - erpnext_navbar_items = [ { - "item_label": "Documentation", + "item_label": _("Documentation"), "item_type": "Route", "route": "https://docs.erpnext.com/", "is_standard": 1, }, { - "item_label": "User Forum", + "item_label": _("User Forum"), "item_type": "Route", "route": "https://discuss.frappe.io", "is_standard": 1, }, { - "item_label": "Frappe School", + "item_label": _("Frappe School"), "item_type": "Route", "route": "https://frappe.io/school?utm_source=in_app", "is_standard": 1, }, { - "item_label": "Report an Issue", + "item_label": _("Report an Issue"), "item_type": "Route", "route": "https://github.com/frappe/erpnext/issues", "is_standard": 1, diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py index eae5c9f6c74..b7436a140f8 100644 --- a/erpnext/setup/utils.py +++ b/erpnext/setup/utils.py @@ -234,3 +234,15 @@ def welcome_email(): site_name = get_default_company() or "ERPNext" title = _("Welcome to {0}").format(site_name) 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