You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An SPI that can be used to tweak the resolution of the locale when interpolating the constraint violation messages. See <<section-locale-resolver>>.
56
+
54
57
`org.hibernate.validator.spi.nodenameprovider`::
55
58
An SPI that can be used to alter how the names of properties will be resolved when the property path is constructed. See <<section-property-node-name-provider>>.
56
59
@@ -443,6 +446,55 @@ error messages from other resource bundles than _ValidationMessages_ while still
443
446
interpolation algorithm as defined by the specification. Refer to
444
447
<<section-resource-bundle-locator>> to learn how to make use of that SPI.
445
448
449
+
[[section-locale-resolver]]
450
+
=== Customizing the locale resolution
451
+
452
+
[WARNING]
453
+
====
454
+
These contracts are marked as `@Incubating` so they might be subject to change in the future.
455
+
====
456
+
457
+
Hibernate Validator provides several extension points to build a custom locale resolution strategy.
458
+
The resolved locale is used when interpolating the constraint violation messages.
459
+
460
+
The default behavior of Hibernate Validator is to always use the system default locale (as obtained via `Locale.getDefault()`).
461
+
This might not be the desired behavior if, for example, you usually set your system locale to `en-US` but want your application to provide messages in French.
462
+
463
+
The following example shows how to set the Hibernate Validator default locale to `fr-FR`:
0 commit comments