Search results

Localization

The Localization library allows you to localize the static text content of the NoRecordsTemplate and ActionFailureTemplate properties according to the culture currently assigned to the ComboBox.

Locale key en-US (default)
NoRecordsTemplate No records found
ActionFailureTemplate The request failed

Loading translations

  • To download the locale definition of Blazor components, use this link.

  • After downloading the ej2-locale package, copy the ej2-locale folder with required local definition file into wwwroot folder.

  • By default, the ej2-locale package contains the localized text for static text present in components like button text, placeholder, tooltip, and more

In the following sample, French culture is set to the ComboBox and no data is loaded. Hence, the NoRecordsTemplate property displays its text in French culture initially, and if the sample is run offline, the ActionFailureTemplate property displays its text appropriately.

@using Syncfusion.EJ2.Blazor.Data
@using Syncfusion.EJ2.Blazor.DropDowns

<EjsComboBox TValue="string" Query="@Query" Placeholder="Select a customer">
    <EjsDataManager Url="https://ej2services.syncfusion.com/production/web-services/api/Employees" Adaptor="Adaptors.WebApiAdaptor" CrossDomain=true></EjsDataManager>
    <ComboBoxFieldSettings Value="Country" Text="FirstName"></ComboBoxFieldSettings>
</EjsComboBox>

@code {
[Inject]
    protected IJSRuntime JsRuntime { get; set; }

    protected override void OnAfterRender(bool firstRender)
    {
        this.JsRuntime.Ejs().LoadLocaleData("wwwroot/ej2-locale/src/fr.json").SetCulture("fr");
    }
public string Query = "new ej.data.Query().select(['FirstName', 'Country']).take(6).requiresCount()";
}

The output will be as follows.

ComboBox