Skip to main content

New language variable in invoice backend no work

More
11 years 11 months ago #176933 by crealiagroup
-- HikaShop version -- : 2.3.3
-- Joomla version -- : 3.3.6

Hi,

I've edited the order / invoice.php file for backend template to display a new variable in the invoice:

I've added this:
Code:
<tr> <td colspan="<?php echo $colspan; ?>"> </td> <td class="key"> <label> <?php echo JText::_( 'HIKASHOP_IMPONIBILE' ); ?> </label> </td> <td> <?php echo $this->currencyHelper->format($this->order->order_full_price-$taxes,$this->order->order_currency_id); ?> </td> </tr>

As you can see, I've created the language variable HIKASHOP_IMPONIBILE that I've translated into the language override.

The problem is that this variable is not translated. I've tryed also a test changing HIKASHOP_IMPONIBILE with the variable VAT (that is a default variable of hikashop, but even in this case in the invice output it's shown as HIKASHOP_IMPONIBILE (or VAT in my other test) and so no variables are translated.

At this point I suppose that something is wrong with my code?

Thanks in advice.

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #176953 by nicolas
Hi,

The code is correct so the problem must be with your translation override.
If you turn on the "debug mode" and "language debug" options of the Joomla configuration, you should see the debug data at the bottom of each page and on that page, you should get a debug of the translation file of HikaShop and the override file and it will tell you if there is a problem with them and if so, on which line is the problem.

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago - 11 years 11 months ago #177060 by crealiagroup
[strike]First of all, I've hanged my variable with "TAXES" to be sure that the issue wasn't related to the name of the variable for any reason.

Then I've activated debugs and I've found this issue (that is not related to my problem anyway): JROOT/language/en-GB/en-GB.com_hikashop.ini : error(s) in line(s) 2110, 2112

There is an error in th english translation file:

COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY="Hello administrator,

A new user '%s', username '%s', has registered at %s."


Anyway then I found this message:

**Untranslated Strings**


# JROOT/libraries/legacy/view/legacy.php

TAXABLE="TAXABLE"

What's wrong? It works in frontend, just doesn't work in backen invoice.[/strike]

EDIT: my fault, I was browsing the backend in english but the traslation of variable was only in italian. That's the problem. Sorry...

Anyway the same issue I've found in english language is also present in italian ffile:
JROOT/language/it-IT/it-IT.com_hikashop.ini : errore(i) alla(e) linea(e) 2110, 2112

Thanks anyway!
Last edit: 11 years 11 months ago by crealiagroup.

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #177062 by nicolas
The problem with that translation is that you're not able to have several lines for the same translation.
By default, that translation is like that in HikaShop:
Code:
COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY="Hello administrator,\r\n\r\nA new user '%s', username '%s', has registered at %s."
So please correct it.
All the translations after that line will be ignored by the translation system, so it would well explain the problem.

Also note that if you're customizing the view file, you can directly enter the text there if your website is not multilingual. No need to use a translation override that case.

Please Log in or Create an account to join the conversation.

Time to create page: 0.179 seconds
Powered by Kunena Forum