[Colbox 3.5] New validation frame and i18n error messages error in Railo

Hi All,

I am spending saturday afternoon trying out some of the lovely new Coldbox 3.5 features. I am liking the validation framework very much, but I am having some trouble getting the i18N error messages to work.

You should know that I am using the latest stable release from Railo to test on, and the current stable release for Coldbox 3.5. I am using the default ‘Advanced’ set of templates from the download to test on.

In my handler, I validate the module like this:

var result = validateModel(target: rc.oUser, locale: ‘nl_NL’);

I am expecting a Dutch error message.

But I receive an error:

Error getting language (english (us)) bundle for resource (User.FIRSTNAME.Required). Exception Message The resource bundle file: includes/i18n/main_english (us).properties does not exist.

Notice the name of the file, which is main_english (us).properties. I was expecting main_nl_NL.properties there, which does exist.

Is there a problem using the Validation i18N capabilities in Railo?

Kind regards,

Erik-Jan

Not sure. Need more data here. Do you have already a default locale setup?

Yes, I have set a default locale (also nl_NL). But I did some more research, and it turns out to be the getLocale function in ValidationResult.cfc.

If I change the line where the message is set:

var message = resourceBundle.getResource(resource="#targetName#.#error.getField()#.#error.getValidationType()#",default="",locale=locale);

to use Locale instead of get locale, I get the expected resutl. Railo has a GetLocale function of its own which is being called instead of the function in the CFC.

I know this is not the nicest solution, but I was just trying to figure out where it was failing.

Kind regards,

Erik-Jan

Erik, I was able to reproduce and fixed. This is targeted for our first patch release 3.5.1

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano