When a merchandiser defines a search configuration in the Merchandising UI, he or she selects a language from a preconfigured list. Though the term “language” is used throughout Merchandising, the values selected actually represent Java locales. So, for example, the list of available languages might include both British English (representing the locale en_GB
) and US English (representing the locale en_US
).
When a site visitor enters a search query, the software determines the visitor’s locale, and uses this value in the process of selecting a search configuration. Different sites may use different logic for determining a visitor’s locale. The following steps describe one common approach:
If the URL in the request includes a query parameter that specifies a locale, use that locale.
If the locale is not specified in the URL, examine the current profile’s
locale
property. If this property is set (typically the case only if the user is logged in), use the value of that property.If the
locale
property of the profile is not set, examine the HTTP headers of the request for a locale setting. This is set by the browser based either on a preference setting in the browser itself, or on a value derived from an operating-system setting.