atomic-result-localized-text

This is for:

Developer
In this article

See Display results to learn more about customizing your result templates.

The atomic-result-localized-text component renders a target i18n localized string using the values of a target field.

Given this i18n configuration:

searchInterface.i18n.addResourceBundle('en', 'translation', {
   classic_book_advert: 'Classic book from {{name}}',
});

The component could be configured in such a way to replace {{name}} with the author field value from the result item:

<atomic-result-localized-text locale-key="classic_book_advert" field-author="name"></atomic-result-localized-text>

Properties

Property Attribute Description Type Default

fieldCount

field-count

The numerical field value used to determine whether to use the singular or plural value of a translation.

string | undefined

localeKey (required)

locale-key

The i18n translation key.

string

field

field

The field from which to extract the target string and the variable used to map it to the target i18n parameter. For example, the following configuration extracts the value of author from a result, and assign it to the i18n parameter name: field-author="name"

Record<string, string>

{}