Search results

Localization

The Localization library allows you to localize static text content of the noRecordsTemplate and actionFailureTemplate  properties according to the culture currently assigned to the DropDownList.

Locale key en-US (default)
noRecordsTemplate No records found
actionFailureTemplate The request failed

Loading translations

To load translation object to your application, use load function of the L10n class.

In the following sample, French culture is set to the DropDownList 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.

tagHelper
localization.cs
<div class="control-wrapper">
    <div id="default" style='padding-top:75px;'>
        <ejs-dropdownlist id="customers" query="new ej.data.Query().select('CustomerID','OrderID').take(10)" placeholder="Select a customer" locale="fr-BE" popupHeight="200px">
            <e-dropdownlist-fields text="CustomerID" value="OrderID"></e-dropdownlist-fields>
            <e-datamanager url="http://js.syncfusion.com/demos/ejServices/Wcf/Northwind.svc/Orders/" crossDomain="true"></e-datamanager>
        </ejs-dropdownlist>
    </div>
</div>
<script>
    ej.base.L10n.load({
        'fr-BE': {
            'dropdowns': {
                'noRecordsTemplate': "Aucun enregistrement trouv�",
                'actionFailureTemplate': "Mod�le d'�chec d'action"
            }
        }
    });
</script>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using WebApplication1.Models;

namespace WebApplication1.Controllers
{
    public class DropDownListController : Controller
    {
        public IActionResult localization()
        {
            return View();
        }
    }
}