New language variable in invoice backend no work
- crealiagroup
-
Topic Author
- Offline
Less
More
11 years 11 months ago #176933
by crealiagroup
New language variable in invoice backend no work was created 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:
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.
-- 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.
11 years 11 months ago #176953
by nicolas
Replied by nicolas on topic New language variable in invoice backend no work
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.
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.
- crealiagroup
-
Topic Author
- Offline
11 years 11 months ago - 11 years 11 months ago #177060
by crealiagroup
Replied by crealiagroup on topic New language variable in invoice backend no work
[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!
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.
11 years 11 months ago #177062
by nicolas
Replied by nicolas on topic New language variable in invoice backend no work
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:
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.
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."
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