fix: dont translate syntax error messages

closes https://github.com/frappe/frappe/issues/26443
This commit is contained in:
Ankush Menat 2024-05-16 18:54:59 +05:30
parent 78321360a6
commit afed21e29f
2 changed files with 4 additions and 1 deletions

View file

@ -17,6 +17,7 @@ from frappe.translate import (
extract_messages_from_javascript_code,
extract_messages_from_python_code,
get_language,
get_messages_for_app,
get_parent_language,
get_translation_dict_from_file,
)
@ -314,6 +315,8 @@ def verify_translation_files(app):
lang = file.stem # basename of file = lang
get_translation_dict_from_file(file, lang, app, throw=True)
get_messages_for_app(app)
expected_output = [
("Warning: Unable to find {0} in any table related to {1}", "This is some context", 2),

View file

@ -66,7 +66,7 @@ def validate_template(html):
try:
jenv.from_string(html)
except TemplateSyntaxError as e:
frappe.throw(frappe._(f"Syntax error in template as line {e.lineno}: {e.message}"))
frappe.throw(f"Syntax error in template as line {e.lineno}: {e.message}")
def render_template(template, context=None, is_path=None, safe_render=True):