mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 07:54:46 +00:00
fix: use pseudo-translation while creating fixtures
This commit is contained in:
@@ -7,7 +7,6 @@ import os
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
|
||||||
from frappe.desk.doctype.global_search_settings.global_search_settings import (
|
from frappe.desk.doctype.global_search_settings.global_search_settings import (
|
||||||
update_global_search_doctypes,
|
update_global_search_doctypes,
|
||||||
)
|
)
|
||||||
@@ -18,6 +17,14 @@ 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
|
||||||
|
|
||||||
|
|
||||||
|
def _(x, *args, **kwargs):
|
||||||
|
"""Redefine the translation function to return the string as is.
|
||||||
|
|
||||||
|
We want to create english records but still mark the strings as translatable.
|
||||||
|
The respective DocTypes have 'Translate Link Fields' enabled."""
|
||||||
|
return x
|
||||||
|
|
||||||
|
|
||||||
def read_lines(filename: str) -> list[str]:
|
def read_lines(filename: str) -> list[str]:
|
||||||
"""Return a list of lines from a file in the data directory."""
|
"""Return a list of lines from a file in the data directory."""
|
||||||
return (Path(__file__).parent.parent / "data" / filename).read_text().splitlines()
|
return (Path(__file__).parent.parent / "data" / filename).read_text().splitlines()
|
||||||
|
|||||||
Reference in New Issue
Block a user