News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

[SOLVED] Multi-language VAT rule is not translated in several places

Started by acarvalho, March 26, 2021, 19:36:28 PM

Previous topic - Next topic

acarvalho

I'm using the latest VM, and for my VAT rule, I defined a language constant in English and Portuguese: COM_VIRTUEMART_VATRULE="VAT (23%)" (and for the PT: "IVA (23%)").

I placed this language constant into the VAT rule, the .ini files for my template and at the language override for the admin in both languages.

When I go to the rule definition, it is correctly trranslated in the back-end.

At the front-end it is correctly translated.

The issue is when the checkout is done and the system sends the email, the column for the VAT displays the constant (COM_VIRTUEMART_VATRULE) and not the translated value!
The same happens at the order edit at the back-end (at the details table) and also at the product edit (the caption at the price "Tax Affecting:") although the VAT rule at the dropdown is translated!

I even placed the constant + value at the language override of the front, but no luck!

How can this be solved?

Jörgen

Another unknown Vm version and perhaps unknown template overrides ?

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

acarvalho

I'm using the latest VM: 3.8.8 10472
Joomla 3.9.25
I don't have any overrides for the email product list, nor the admin template.

I'm using the new admin template. I know it's a beta, but the same happened with the original template, I just tested it.

Have you tried it yourself?

Jörgen

QuoteI even placed the constant + value at the language override of the front, but no luck!

What does this mean ?

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

jenkinhill

Are you using <?php echo vmText::_('COM_VIRTUEMART_VATRULE') ?>  to display the text in the templates? 
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

pinochico

No, only. place in DB as name of rules and into ini file for template, isn't it?  :)
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

acarvalho

The best is to show you:

When I create the VAT rule, I place the constant at its title field, and it displays correctly at the back-end:


The list of the VAT rules prove that it is translated (I have it translated in all languages at my .ini files for the overrides and front language .ini files):


At the front it displays correctly:


It's when it sends the email that it starts to show the issue:


Also at the product details setup at the back-end (Note that at the dropdown it is translated, but the caption on the right is not):


At the orders, not translated:


Also I found out that even if I change the translation, or even remove the constant, the emails sent for this order (if I change the state of the order I have it set-up to send an email), it always sends with the original (in this case) issue (not translated)!!

Can anyone help me, please?

pinochico

www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

acarvalho

But the language override for the admin should be enough, it overrides everything in the back-end.

What other overrides are there for the back-end?
(note that I don't want to touch the original language ini files, as soon as the component is updated, the changes are gone).

Jörgen

IVA 27% an VAT is not the same language key. It is hard to follow your example.
I would guess that You should check Your overrides to see if this is included correctly:
<td style="text-align: right;width: 11%;"><strong><?php echo vmText::_('COM_VIRTUEMART_ORDER_PRINT_SUBTOTAL_DISCOUNT_AMOUNT'?></strong></td>

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Studio 42

If you translate in the right language in front+admin. It should be right
Adding a language key in the template is not always used, so use standard Joomla override for each language.

acarvalho

Quote from: Jörgen on April 05, 2021, 22:46:36 PM
IVA 27% an VAT is not the same language key. It is hard to follow your example.
My example at the back-end is in English and the Front is in Portuguese.

All is working as expected in the front! Sorry for not having it in English, I assure you the translation also works in the front for every language.

Also, how can you explain that the constant is correctly translated in the back-end in the VAT rule definition (I've switched my language to see it in Portuguese and English and it is translated).

What I've found is that VM saves the VAT rule into this table: #__virtuemart_order_calc_rules and in the column calc_rule_name it places my constant and not the translated value.

Quote from: Studio 42 on April 06, 2021, 09:02:21 AM
If you translate in the right language in front+admin. It should be right
Adding a language key in the template is not always used, so use standard Joomla override for each language.
That's what I'm doing, as explained, I have used the labguage override for the admin in every language (stored in /administrator/language/overrides), and it partially works (as explained and detailed in my examples), and also at my template language files (in my template files), and as shown, it works.

The only thing that doesn't work is at the email, orders and partially at the product edit.

The key is where VM updates the db with the constant for the VAT rule, it is ignoring the translation.

Could any of you try it by yourself? it doesn't even need to be multi-language. Just place a constant into the VAT rule and translate it in the language overrides and in your template language, then see what happens.

Jörgen

QuoteThe key is where VM updates the db with the constant for the VAT rule, it is ignoring the translation.
Why should is store the translated value ? And if it did in which language, the calcs table should be for all languages right ?

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

acarvalho

Quote from: Jörgen on April 06, 2021, 10:29:26 AM
QuoteThe key is where VM updates the db with the constant for the VAT rule, it is ignoring the translation.
Why should is store the translated value ? And if it did in which language, the calcs table should be for all languages right ?
Of course not, I just pointed out the place where the constant is saved in that particular table, and it may help the devs. I don't appreciate your sarcasm.

Also, did you read that even if I change the VAT rule name (can even be something not to be translated), it will always use the initial one that the order used? (the initial one saved in the database table for that order).

Have you tried it yourself? I'm curious to see your findings.

I'm positive this is not working correctly and either there is a place for this kind of translation (which may not be standard, because I'm more than used to do this kind of translations with the ini files and ini overrides), or there is a different techinque to translate these elements? (like the one for the products, where VM has a table for each language).

Jörgen

I know when I am not wanted, this is not sarkasm ...

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.