Please enable JavaScript to view this site.

HsM Reference Manual

Navigation:  Common aspects

Localization and language handling

HsM is designed to adapt to the user’s locale. A locale is a set of language- or country-specific preferences for a user interface, including (among other things) language, date formats, number formatting, and string-sorting rules.

HsM uses BCP 47 language tags (as defined primarily in RFC 5646) to label content with its locale and to express requested locales on various interfaces (e.g., REST APIs).

Because not all user-requested locales are supported in every part of the system, HsM applies a lookup procedure similar to the algorithm described in RFC 4647, Section 3.4, selecting the single locale that best matches the user’s locale-priority list.

However, HsM intentionally deviates from RFC 4647 in the following ways:

Wildcard (*) ranges in requested locales are not supported.

If no match is found, HsM uses en as a designated fallback locale.

If content is not available in this fallback locale either, HsM selects the first locale from the list of available locales.

Example 1:

Available locales: en, de

Requested locale: en-US,

Direct match: en-US - no match found

Next best match: en - match found

Result: en

Example 2:

Available locales: en, en-US

Requested locale: de-DE

Direct match: de-DE - no match found

Next best: de - no match found

Fallback locale: en - match found

Result: en

Example 3:

Available locales: ru, es
Requested locale: de-DE,

Direct match: de-DE - no match

Next best: de - no match found

Fallback locale: en - no match found

First available: ru

Result: ru

Example 4:

Available locales: en, es
Requested locale: pt-PT, es

Direct match: pt-PT - no match

Next best: pt - no match found

Direct match: es - match found

Result: es