fix: use pseudo-translation while creating fixtures

This commit is contained in:
barredterra
2024-08-17 01:57:44 +02:00
parent 1bdeddcb04
commit 77e5787036

View File

@@ -7,7 +7,6 @@ import os
from pathlib import Path
import frappe
from frappe import _
from frappe.desk.doctype.global_search_settings.global_search_settings import (
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
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]:
"""Return a list of lines from a file in the data directory."""
return (Path(__file__).parent.parent / "data" / filename).read_text().splitlines()