JAXP is an API; it is up to the actual implementation (for example, Apache Xerces
) to provide localization-aware messages.
Normally, though, system-level libraries and implementations (such as JAXP & Xerces) will provide messages localized based on the system's default locale (whatever is returned from the expression java.util.Locale.getDefault()
); this is, again, OS-specific.
On Microsoft Windows, for example, you can change your system's default locale using the Regional Settings
window.
If you want, you can override the "default locale" used by the JVM by specifying the user.language
and user.region
system properties (for example, -Duser.language=fr
and -Duser.region=CA
would make the JVM yield "Canadian French" as a default locale. Eventually, this setting will get to JAXP's code. If Xerces provides Canadian French resource bundles, then Canadian French messages will be emitted.