feat: pass doctype as context when translating label

This commit is contained in:
barredterra
2024-02-16 16:29:40 +01:00
parent 506fefa186
commit 0b3ecd24e2
4 changed files with 4 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
if((df.fieldname !== "description" && df.fieldname !== "item_name") && val) { %}
<div class="row">
<div class="col-xs-4 ellipsis">
<strong title="{%= __(df.label) %}">{%= __(df.label) %}:</strong>
<strong title="{%= __(df.label, null, df.parent) %}">{%= __(df.label, null, df.parent) %}:</strong>
</div>
<div class="col-xs-8">
{%= doc.get_formatted(df.fieldname) %}

View File

@@ -7,7 +7,7 @@
</div>
{% else %}
<div class="col-xs-5 {%- if doc.align_labels_right %} text-right{%- endif -%}">
<label>{{ _(df.label) }}</label></div>
<label>{{ _(df.label, context=df.parent) }}</label></div>
<div class="col-xs-7 text-right">
{{ doc.get_formatted("total", doc) }}
</div>