Adjustment plugin labels not translated in Order Summary template

Created on 6 November 2020, over 3 years ago
Updated 6 April 2023, about 1 year ago

Problem/Motivation

The adjustment plugin labels (~ Tax plugin) are not translated in the Order Summary template.

Steps to reproduce

Proposed resolution

Give a translation to the labels through pipe in the twig template.

Remaining tasks

User interface changes

Here is shown that the FR translations are still shown in the DE template

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

2.0

Component

Order

Created by

🇨🇭Switzerland Ginovski Bern

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇬Bulgaria pfrenssen Sofia

    The approach in the patch is not right, for many adjustments the data is dynamic and should not be used with t().

  • 🇮🇳India rckstr_rohan

    his , use a mapping to retrieve the correct translation for each label is more useful for dynamic datas

    Example:

    {% set adjustmentTranslations = {
    'shipping': 'Shipping',
    'tax': 'Tax',
    'discount': 'Discount',
    'fee': 'Fee',
    } %}

    {% for adjustment in totals.adjustments %}

    {{ adjustmentTranslations[adjustment.type] }} {{ adjustment.amount|commerce_price_format }}

    {% endfor %}

Production build 0.69.0 2024