View Full Version : Storing Locale file variables in JSON

4 Oct 2012, 11:35 PM

In my project i'm using a locale file where all the static text will be present.


var TASK= {

TEXT : 'My text'

In JS files if i want to display the data then im using as TASK.TEXT.

My json is:

"Name" : "TASK.TEXT",

Now my requirement is to display the data from json where json should contain locale variables where user can change easily. But the above is returning as a string 'TASK.TEXT' but not the value 'My text'. Tried with eval,Ext.encode but no luck.

Any suggestions to achieve this?

5 Oct 2012, 12:50 AM
I couldn't understand your question. Please be more clear. Post some code if possible.

Premkumar. A

17 Oct 2012, 8:42 PM
Hi i got ..
In fields evaluate the local text(TASK.TEXT),like
fields : [ {
name: 'Name',
convert: function( value, record ) {

var recordValue = record.raw.Name;
return eval( recordValue );