I have an object that contains another object with translations. It looks like this:
var parent = { //parent object with a bunch of stuff in it
countryAlerts:{ //area for country alerts
"USA":{ //country
en:"FAST", //alert text in English
es:"RAPIDO" //alert text in Spanish
},
"Japan":{
en:"FAST",
es:"RAPIDO"
}
}
}
I would like to do something like this:
var parent = {
countryAlerts:{
"USA":fast,
"Japan":fast
}
}
var fast = {
en:"FAST",
es:"RAPIDO"
}
I can't seem to get it to work though. I would like to refer to the object like this: parent.countryAlerts.USA.LANGUAGE
.
Any help is appreciated.
Thanks!