Tax descriptor Translation on confirmation Emails

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
xarga
Posts: 43
Joined: 16 Dec 2019, 22:54

Tax descriptor Translation on confirmation Emails

Post by xarga » 22 Apr 2020, 20:56

I've got translations in place in shop.php and they for the most part are working.
But on the confirmation email I'm getting

+ 7.75% VAT but instead I need +7.75% Tax

In shop.php I have

Code: Select all

 'i18n' => [
        'en' => [
            'client' => [
                'Telephone' => ['Mobile phone'],
                'We have received your payment, and will take care of your order immediately.' => ['We have received your payment and are processing your order. Please Note:  All orders (especially large orders) are subject to availability and will be confirmed by phone.
Same day orders should be placed before 2pm and are subject to availability'],
                'delivery' => ['Delivery method'],
                'tax' => ['Tax'],
                'VAT ID' => ['Tax ID'],
            ],
            'controller/frontend' => [
                'Telephone' => ['Mobile phone'],
                'We have received your payment, and will take care of your order immediately.' => ['We have received your payment and are processing your order. Please Note:  All orders (especially large orders) are subject to availability and will be confirmed by phone.
Same day orders should be placed before 2pm and are subject to availability'],
                'delivery' => ['Delivery method'],
                'tax' => ['Tax'],
                'VAT ID' => ['Tax ID'],
            ],
            'mshop' => [
                'Telephone' => ['Mobile phone'],
                'We have received your payment, and will take care of your order immediately.' => ['We have received your payment and are processing your order. Please Note:  All orders (especially large orders) are subject to availability and will be confirmed by phone.
Same day orders should be placed before 2pm and are subject to availability'],
                'delivery' => ['Delivery method'],
                'tax' => ['Tax'],
                'VAT ID' => ['Tax ID'],

            ],
        ],
    ],
And the code in email template that I believe is generating this value is

Code: Select all

 <td class="label"><?= $enc->html(sprintf($priceItem->getTaxFlag() ? $this->translate('client', 'Incl. %1$s%% %2$s') : $this->translate('client', '+ %1$s%% %2$s'), $this->number($taxRate), $this->translate('client/code', 'tax' . $taxName))); ?></td>


Any idea why this is not working?

User avatar
aimeos
Administrator
Posts: 8647
Joined: 01 Jan 1970, 00:00

Re: Tax descriptor Translation on confirmation Emails

Post by aimeos » 23 Apr 2020, 07:55

Use

Code: Select all

'client/code' => [
	'tax' => 'Tax'
]
as the domain for 'tax{name}' is "client/code", not "client" in the line you have mentioned.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

xarga
Posts: 43
Joined: 16 Dec 2019, 22:54

Re: Tax descriptor Translation on confirmation Emails

Post by xarga » 24 Apr 2020, 02:35

Thank you - that worked -

By the way I did notice that I get unexpected results if the translated value is not set as an array.

For example

Code: Select all

'client'=>[ 
                    'delivery' => 'Delivery method',
                ],
Returned a only a 'D'

Whereas

Code: Select all

'client'=>[ 
                    'delivery' =>[ 'Delivery method'],
                ],
returns the full string.

User avatar
aimeos
Administrator
Posts: 8647
Joined: 01 Jan 1970, 00:00

Re: Tax descriptor Translation on confirmation Emails

Post by aimeos » 25 Apr 2020, 07:59

You are right, it must be an array. Haven't noticed that but the docs are correct:
https://aimeos.org/docs/Laravel/Overwrite_translations
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply