We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Set locale globally

Thread ID:

Created:

Updated:

Platform:

Replies:

119470 Jun 25,2015 01:30 PM Jun 26,2015 08:20 AM ASP.NET Web Forms 1
loading
Tags: General
Dmitry
Asked On June 25, 2015 01:30 PM

Hello!

Is there any way to set locale globally for all controls at one place? So I could write something like this:

<script>

ej.LocaleManager.setLocale("ru-RU");

<script>

I've searched but not found any information in documentation or forums, there are only help topics about how to set locale for concrete instance of localizablу controls.
Any help would be appreciated.

Ezhil S [Syncfusion]
Replied On June 26, 2015 08:20 AM

Hi Dmitry,

Thanks for your interest with Syncfusion products.

Currently we haven’t provided in built support to set Locale for all Syncfusion control in application wide. You can achieve this by setting the “locale” property for all the Syncfusion widgets before the control is rendered. Please refer the following code snippet,
<code>
[Script]
[Site.Master]

        <script type="text/javascript">

                var globallocale = "ru-RU";

                var widgetsall = ej.widget.registeredWidgets;

                for (var wd in widgetsall) {

                    //this will set locale property to the `ru-RU` if locale property is available in defaults.

                    if (ej.getObject("proto.defaults.locale", widgetsall[wd]))

                        ej.createObject("locale", globallocale, widgetsall[wd].proto.defaults);

                }
        </script>
</code>
Note: You have to add the above code in Master page or before the control rendering so that the locale will be set for all the controls.

Sample prepared can be downloaded from the link below:
http://www.syncfusion.com/downloads/support/forum/119470/ze/Localization-918737638

Please let us know if you have any other queries.

Regards,
Ezhil S


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;