$webinfo("Locale")

Use $webinfo("Locale") to set the client-side locale in a DSP application. The value is used by the DSP client for locale-based formatting.

$webinfo("Locale") = Locale | $nlslocale

Values

  • Locale—literal locale name, for example "en_UK", "fr", or "fr_CA".
  • $nlslocale—value of the NLS locale use for locale-based processing on the server.

Use

Use only in dynamic server pages.

Description

The DSP locale has session scope and is only applied in a full-page refresh, so it is typically set on a main DSP component, either in or before the postActivate trigger. If it is set after the DSP has been activated, a full page refresh is needed for the change to take effect.

Note: Currently, the value of $webinfo ("Locale") is only used to format Date, Datetime, and Time values in HTML input controls.

NLS Locale vs. DSP Client Locale

The value of $webinfo("Locale") is completely independent of the Uniface NLS locale, as set or returned by the assignment setting $NLS_LOCALE or the function $nlslocale. The NLS locale is used in locale-based processing on the server, which is handled by the ICU library.

If you set the server-side locale in ProcScript using $nlslocale, this should be done early, for example in the Set State trigger.

You can try to align client- and server-side locales for DSPs using the following command:

$webinfo("Locale") = $nlslocale

However, note that:

  • The locales supported by $webinfo("Locale") and $nlslocale are not the same. The DSP will try to find an appropriate match, but if this fails, it falls back to the generic locale "en".
  • Even if the same locale name is supported, the results may be different on the DSP client than on the server because processing is entirely dependent on the libraries (JavaScript vs. ICU).
  • The $nlslocale values of system and classic are ignored.