> You are right, its a slightly inconsistent behavior on the grid columns. If you are using a glustore with a model, then I believe the translation will work with the specific locale like you are looking for. Since I haven't ever personally used either, I just declare my locale translations in the "global" namespace like you figured out and everything works great. If it were me, I'd just move the translations up a level and call it a day :).
I had my glustore configured with a model all along, so maybe I needed to something else. Anyway, since my app might have many grids I did want to "namespace" the local file by viewModel names. So, I changed the code in /adapters_extjs4/grid.js as follows. This seems to fix it without breaking anything. Maybe there is a reason not to do this that I haven't hit yet!
if( glu.isArray( config.columns ) ){
for( var i = 0, len=config.columns.length; i < len; i++ ){
var col = config.columns[i];
if( col.header && col.header.indexOf(glu.conventions.localizeStart) == 0 && glu.symbol(col.header).endsWith(glu.conventions.localizeEnd)){
// v1.2.2 For store viewmodels for localisation we actually want the viewmodel that is the parent
// of the store so we have the correct viewmodelName to use in the localizer.
// Was this:
// col.header = glu.localize({ns:viewmodel.ns, viewmodel:config.store, key:col.header});
// Now this:
col.header = glu.localize({ns:viewmodel.ns, viewmodel:config.store.parentVM, key:col.header});
}
if( col.text && col.text.indexOf(glu.conventions.localizeStart) == 0 && glu.symbol(col.text).endsWith(glu.conventions.localizeEnd)){
// v1.2.2 see above
//col.text = glu.localize({ns:viewmodel.ns, viewmodel:config.store, key:col.text});
col.text = glu.localize({ns:viewmodel.ns, viewmodel:config.store.parentVM, key:col.text});
}
if( col.editor && typeof(col.editor) == 'object' && col.editor.store && typeof(col.editor.store) == 'string' && col.editor.store.indexOf(glu.conventions.bindingSymbol) == 0){
var bindings = glu.provider.binder.collectBindings(col.editor, viewmodel);
glu.provider.binder.applyBindingsList(bindings);
}
}
}
At some stage I will do a pull request on the changes I have made. :-)
Cheers,
Murray