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 |
Re: Using Translation Labels in JavsScript
Untested:
Code:
<script> |
Re: Using Translation Labels in JavsScript
Here is how you can do it:
Code:
var myLabel; 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). |
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:
<div id="myWidget"> PHP Code:
Code:
core.microhandlers.add( |
All times are GMT -8. The time now is 11:11 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.