Merge pull request #39936 from barredterra/label-context

This commit is contained in:
Raffael Meyer 2024-02-29 15:09:49 +01:00 committed by GitHub
commit b235f48067
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@
<div class="row {% if df.bold %}important{% endif %} data-field">
<div class="col-xs-{{ "9" if df.fieldtype=="Check" else "5" }}
{%- if doc.align_labels_right %} text-right{%- endif -%}">
<label>{{ _(df.label) }}</label>
<label>{{ _(df.label, context=df.parent) }}</label>
</div>
<div class="col-xs-{{ "3" if df.fieldtype=="Check" else "7" }} value">
{% if doc.get(df.fieldname) != None -%}

View File

@ -15,7 +15,7 @@ frappe.ui.form.on('Item Variant Settings', {
frappe.model.with_doctype('Item', () => {
const field_label_map = {};
frappe.get_meta('Item').fields.forEach(d => {
field_label_map[d.fieldname] = __(d.label) + ` (${d.fieldname})`;
field_label_map[d.fieldname] = __(d.label, null, d.parent) + ` (${d.fieldname})`;
if (!in_list(exclude_field_types, d.fieldtype)
&& !d.no_copy && !in_list(exclude_fields, d.fieldname)) {

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>