Skip to content

Commit 8a4b42e

Browse files
authored
fix: translate only translatable fields (#57)
* fix: translate only translatable fields * refactor: rename variable
1 parent e3000b6 commit 8a4b42e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frappe_graphql/utils/resolver/document_resolver.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ def _get_value(fieldname, ignore_translation=False):
6767

6868
# ignore_doc_resolver_translation might be helpful for overriding document_resolver
6969
# which might be a simple wrapper around this function (document_resolver)
70+
_df = meta.get_field(info.field_name)
7071
if not ignore_translation and isinstance(
71-
value, str) and not frappe.flags.ignore_doc_resolver_translation:
72+
value, str) and not frappe.flags.ignore_doc_resolver_translation and _df and cint(
73+
_df.get("translatable")):
7274
return frappe._(value)
7375

7476
if __ignore_perms:

0 commit comments

Comments
 (0)