xml - I18n of XSD validation error messages in Java -
i perform xsd xml validation using following classes:
import javax.xml.validation.schema; import javax.xml.validation.schemafactory; import javax.xml.validation.validator;
the problem xsd error messages returned validator in english language. possible call locale-aware validation jaxp api?
jaxp api; actual implementation (for example, apache xerces
) provide localization-aware messages.
normally, though, system-level libraries , implementations (such jaxp & xerces) provide messages localized based on system's default locale (whatever returned expression java.util.locale.getdefault()
); is, again, os-specific.
on microsoft windows, example, can change system's default locale using regional settings
window.
if want, can override "default locale" used jvm specifying user.language
, user.region
system properties (for example, -duser.language=fr
, -duser.region=ca
make jvm yield "canadian french" default locale. eventually, setting jaxp's code. if xerces provides canadian french resource bundles, canadian french messages emitted.
Comments
Post a Comment