New language variable in invoice backend no work

  • Posts: 117
  • Thank you received: 3
10 years 1 month ago #176933

-- 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:

<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.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 1 month ago #176953

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.

  • Posts: 117
  • Thank you received: 3
10 years 4 weeks ago #177060

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.


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: 10 years 4 weeks ago by crealiagroup.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 4 weeks ago #177062

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:

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.056 seconds
Powered by Kunena Forum