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:
Raffael Meyer
2025-11-15 19:34:13 +01:00
committed by Mergify
parent 8c98f1692a
commit 088bbac543
3 changed files with 24 additions and 5 deletions

View File

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