Contents
- Loading translations
- See also
Having trouble getting help?
Contact Support
Contact Support
Localization in Combo Box Control
19 Dec 20222 minutes to read
The Localization library allows to localize 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 load translation object to your application, use load
function of L10n class.
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.
<div id='remote-data' class='col-lg-6' style='padding-top:15px'>
<div class='content'>
<ejs-combobox id="customers" locale="fr-BE" query="new ej.data.Query().from('Customers').select(['ContactName', 'CustomerID']).take(0)" placeholder="Select a customer" popupHeight="200px">
<e-combobox-fields value="ContactName"></e-combobox-fields>
<e-data-manager url="https://services.odata.org/V4/Northwind/Northwind.svc/" adaptor="ODataV4Adaptor" crossDomain="true"></e-data-manager>
</ejs-combobox>
</div>
</div>
<script>
ej.base.L10n.load({
'fr-BE': {
'dropdowns': {
'noRecordsTemplate': "Aucun enregistrement trouvé",
'actionFailureTemplate': "Modèle d'échec d'action"
}
}
});
</script>
NOTE