#1066 format-date() outputs [Language:en] on non-English Locale

v9.2
closed
Michael Kay
5
2012-10-08
2010-04-28
Michael Kay
No

If the default locale on the machine (or Java platform) is one that Saxon does not support, for example Russian, Saxon prefixes the output for format-date() and related functions with "[Language: en]".

This is actually now working correctly in Saxon in cases where your default Locale is say Germany or France - any locale that Saxon supports. The set of locales that Saxon supports is open-ended - it depends on what localisation modules have been registered with the Configuration.

The specification states: The set of languages, calendars, and countries that are supported in the date formatting functions is implementation-defined. When any of these arguments is omitted or is an empty sequence, an implementation-defined default value is used.

In the case of Saxon, the implementation-defined default is taken from the Java default locale, which in this case means that the default language is Russian. This means that Saxon doesn't distinguish the cases where you omit the language argument, and cases where you explicitly ask for Russian. In both cases, if you fail to register a localisation module for Russian, Saxon will fall back to English and warn you that it has done so, as required by the spec.

This patch makes the logic a bit more subtle: Saxon no longer outputs the warning message that a fallback language is being used unless a specific language was explicitly requested in the call to format-date().

Discussion

  • Michael Kay
    Michael Kay
    2010-08-09

    Fixed in 9.2.1.2