Fix lang and locale settings for baseEngine use

This commit is contained in:
dotasek.dev 2024-01-31 15:21:32 -05:00
parent 464af9de90
commit 77f8cdb9df
1 changed files with 7 additions and 1 deletions

View File

@ -492,7 +492,13 @@ public class ValidationService {
ValidationEngine validator;
if (hasBaseEngineForKey(cliContext.getBaseEngine())) {
System.out.println("Getting base engine: " + cliContext.getBaseEngine());
validator = new ValidationEngine(getBaseEngine(cliContext.getBaseEngine()));
validator = new ValidationEngine(getBaseEngine(cliContext.getBaseEngine()));
/* As a service, it wouldn't be efficient to have a base validation engine
* for every language. So we just use the baseEngine and set the language
* manually afterward.
*/
validator.setLanguage(cliContext.getLang());
validator.setLocale(cliContext.getLocale());
} else {
System.out.println("Building new validator engine.");
if (cliContext.getSv() == null) {