fix: Translate names if "Translate Link Fields" is enabled
This commit is contained in:
parent
42f977ef59
commit
943adecae3
1 changed files with 6 additions and 0 deletions
|
|
@ -752,8 +752,14 @@ def get_link_options(web_form_name, doctype, allow_read_on_all_link_options=Fals
|
|||
if meta.translated_doctype:
|
||||
# Translate the labels if "Translate Link Fields" is enabled
|
||||
link_options = [{"value": row.value, "label": _(row.label)} for row in link_options]
|
||||
|
||||
return json.dumps(link_options, default=str)
|
||||
else:
|
||||
if meta.translated_doctype:
|
||||
# Add `label` as the translated name if "Translate Link Fields" is enabled
|
||||
return [{"value": row.value, "label": _(row.value)} for row in link_options]
|
||||
|
||||
# Use the actual names as options without labels
|
||||
return "\n".join([str(doc.value) for doc in link_options])
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue