Render localized display text

Sitecore Search is a headless search platform, so the data it returns can be represented using your preferred format, structure, or component. By using contextual searches, locale settings, and other Search features, you can provide content that is localized to specific regions and customers.

A localized implementation returns content for an application from localized indexed items, where each item is structured as defined by its entity.

Tip

You can create localized values for sorting options and facets by importing them in a CSV.

Search provides the following options for localizing static and display text. Your developer can recommend the optimal way to add localized display text into templates.

Set localized values to attributes

Adding attributes for static and display text to an entity allows you to provide their localized values in each item of that type. You can add as many of these attributes to an entity as needed for complete localization. During indexing, the localized values are stored in your indexed items.

The following procedure includes an example of localizing the Search button within the preview search widget.

To set localized values to attributes:

  1. In your entities, add an attribute label_search_button and do the following:

    • In the Data Type drop-down list, click String.

    • In the Default Value input field, enter Search.

  2. In your localized items, for label_search_button, set the localized value.

  3. Optionally, in a localized crawler, in the document extractor, set label_search_button to the localized value.

  4. Ask your developer to set the button label to the label_search_button attribute of an entity.

Add localized text in page and widget templates

Most websites and ecommerce applications integrated with Sitecore Search are built with page and widget templates. At runtime, based on the URL, the web application selects a template, populates it, and renders it.

To add localized text in page and widget templates:

  • Request your developer to update templates with localized text values.

Important

This option requires a developer to modify page and widget templates.

Do you have some feedback for us?

If you have suggestions for improving this article,