[coldbox-3.7.0] validation messages with custom i18n

Hi all. I’m using ValidBox and recently migrated my resource bundles from .properties files to a custom MongoDB backed system.

What would be the best way to get ValidBox to pull my error messages from MongoDB (using {ObjectName}.{Field}.{ConstraintType}} as the key)? I’m thinking I should write my own implementation of coldbox.system.validation.result.IValidationResult, but I’m not sure how I would tell ColdBox to use it? Would I map it somehow in Wirebox config?

Or, could/should I somehow override the ResourceBundle plugin globally in my app, so the injection of coldbox:plugin:ResourceBundle in the ValidationManager (and anywhere else presumably) uses my ResourceBundle object instead? I’m thinking that might be a better approach. I just read I can do this with coldbox.coldboxExtensionsLocation.

Thanks in advance for the advice.

My first thought is to extend the resource bundle plugin and make your own. Will you be caching the data in memory when the app starts up, or hitting Mongo for it every time?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

I lazy-load RB keys into a structure in the variables scope of my component, which is cached into application scope.

Looks like using extensions is the way to go, thanks Brad for the sanity check :slight_smile: