Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n validation for multiple modules with seperate bundles #31

Open
ozzway opened this issue Jun 8, 2019 · 0 comments
Open

i18n validation for multiple modules with seperate bundles #31

ozzway opened this issue Jun 8, 2019 · 0 comments

Comments

@ozzway
Copy link

ozzway commented Jun 8, 2019

When using multiple modules in a ColdBox application that have module specific i18n resourceBundle declarations in ModuleConfig.cfc as follows:

i18n = {
	resourceBundles = {
		"myBundle" = "#moduleMapping#/includes/i18n/myBundle"
	}
};

i18n validations will only work with default bundle for the entire application and not for a module that has its own declared bundle.

When considering the IValidationResult function addError( required IValidationError error ) function in ValidationResult.cfc component, there is no way to pass the 'bundle' parameter to var message = resourceService.getResource function so that i18n validation can be targeted to a specific bundle. Ideally, one should be able to validate an object and pass a 'bundle' alias so that the i18n type validation can be validated against the correct bundle. eg,

var validationResults = validateModel(target=rc.objEntity, locale=i18n.getFWLocale(), bundle="myBundle");

I'm happy to take a stab at correcting this and creating a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants