Search results

Localization

Localization library allows to localize the default text content of Dialog. In Dialog, The close button’s tooltip text alone will be localize based on culture.

Locale key en-US (default)
close close

Loading translations

To load translation object in an application use load function of L10n class.

In the below sample, French culture is set to Dialog and change the close button’s tooltip text.

tagHelper
controller.cs
<div id='container' style="height:400px;">
    <ejs-button id="targetButton" content="Ouvrir le dialogue"></ejs-button>
    <ejs-dialog id="dialog" locale="fr-BE" showCloseIcon="true" header="Dialogue" content="Dialogue avec la culture française" target="#container" width="250px"></ejs-dialog>
</div>

<script>
    window.onload = function () {
        document.getElementById('targetButton').onclick = function () {
            var dialog = document.getElementById("dialog").ej2_instances[0];
            dialog.show();
        }
        ej.base.L10n.load({
            'fr-BE': {
                'dialog': { 'close': "Fermer" }
            }
        });
    }
</script>
public class HomeController : Controller
{
    public ActionResult Index()
    {
        return View();
    }
}

Output be like the below.

dialog