| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Using Translation Labels in JavsScript | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Using Translation Labels in JavsScript
Hi all,
The .tpl scheme allows translation labels like {t(#Order payment#)} within .tpl files. I was wondering what's the best way to retrieve similar translation labels through JavaScript. For example I would like to add a Title to a part of the page but I would like that title to change languages with different translations that I add through the translation labels system. Any help would be appreciated, Thanks! -Niboon
__________________
Niboon -- Pathos Engineering X-Cart 5.1.10 & 5.2beta |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Using Translation Labels in JavsScript
Untested:
Code:
|
|||||||||
#3
|
|||||||||
|
|||||||||
Re: Using Translation Labels in JavsScript
Here is how you can do it:
Code:
However, the code above should be called after XC5 loads its JS core (otherwise the "core" will be unassigned). For example, you can put this code into your JS object extended from AController, that you load via core.autoload() function (see the source code for examples).
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#4
|
|||||||||
|
|||||||||
Re: Using Translation Labels in JavsScript
Here is another way that does not require asynchronous calls:
1. In your widget class you add getCommentedData() method and make it return an array of parameters and their values. Add your translation there: PHP Code:
Code:
PHP Code:
Code:
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions Last edited by qualiteam : 08-31-2016 at 01:44 AM. |
|||||||||
|
|||
X-Cart forums © 2001-2020
|