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. Image for the cookie policy date

Localization

I'm using this in Global.asax   - > BundleTable.EnableOptimizations = True

This is in aspx page for Language:

 ej.Grid.Locale["hr-HR"] = {
        EmptyRecord: "Nema podataka.",
        Columns: "Kolone",
        SaveButton: "Spremi",
        CancelButton: "Odustani"                 
    };
    ej.Pager.Locale["hr-HR"] = {
        pagerInfo: "{0} od {1} stranice ({2} stavaka)",
        firstPageTooltip: "Na prvu stranicu",
        lastPageTooltip: "Na zadnju stranicu",
        nextPageTooltip: "Sljedeća stranica",
        previousPageTooltip: "Prethodna stranica"
    };

It only works when Optimization is set to False. Why? I need it to be true. Is there any workaround?

6 Replies

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team August 12, 2016 12:33 PM UTC

Hi Hrvoje, 

We are unable to reproduce any issue after enabling the Bundle.EnableOptimization in the WebForms project. 

We have prepared a sample that can be downloaded from the following location. 


If you are still facing any issue, please get back to us with the following details. 

1)      Share the Bundle.Confg and Global.ascx files of your project with us. 
2)      After enabling the Bundle.EnableOptimization, can you able to see the preferred culture file (“ej.culture.hr-HR.min.js”) in the source tab of the browser? 
3)      Where do you placed the bundles scripts/css in sitemaster? Either above the ej.culture or below? 
4)      Do you refer unminified or minified scripts for your project? 
5)      If possible, modify the attached sample and replicate the issue. 

Regards, 
Seeni Sakthi Kumar S. 



HV Hrvoje Voda August 17, 2016 07:21 AM UTC

This is Bundle:

 bundles.Add(New ScriptBundle("~/bundles/WebFormsJs").Include(
                        "~/_COMMON/Scripts/WebForms/WebForms.js",
                        "~/_COMMON/Scripts/WebForms/WebUIValidation.js",
                        "~/_COMMON/Scripts/WebForms/MenuStandards.js",
                        "~/_COMMON/Scripts/WebForms/Focus.js",
                        "~/_COMMON/Scripts/WebForms/GridView.js",
                        "~/_COMMON/Scripts/WebForms/DetailsView.js",
                        "~/_COMMON/Scripts/WebForms/TreeView.js",
                        "~/_COMMON/Scripts/WebForms/WebParts.js"
                        ))



            bundles.Add(New ScriptBundle("~/Scripts/Lib").Include(
                "~/_COMMON/Scripts/grawe.js",
                 "~/_COMMON/Scripts/jquery.js",
                 "~/_COMMON/Scripts/jquery.smartTab.js",
                 "~/_COMMON/Scripts/jquery-ui.js",
                "~/_COMMON/Scripts/ej/ej.web.all.js",
                 "~/_COMMON/Scripts/ej/cultures/ej.culture.hr-HR.min.js"))



            bundles.Add(New StyleBundle("~/Styles").Include(
            "~/_COMMON/Styles/grawe.css",
            "~/_COMMON/Styles/ej/smart_tab.css",
            "~/_COMMON/Styles/jquery-ui.css",
            "~/_COMMON/Styles/ej/flat-saffron/ej.theme.css",
            "~/_COMMON/Styles/ej/flat-saffron/ej.web.all.min.css"
            ))

            bundles.Add(New ScriptBundle("~/bundles/MsAjaxJs").Include(
                "~/_COMMON/Scripts/WebForms/MsAjax/MicrosoftAjax.js",
                "~/_COMMON/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js",
                "~/_COMMON/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js",
                "~/_COMMON/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js"))


Global.asax:

 Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)

        BundleTable.EnableOptimizations = True
        BundleConfig.RegisterBundles(BundleTable.Bundles)
        RouteConfig.RegisterRoutes(RouteTable.Routes)
    End Sub


I'm calling bundle from master page:

 <asp:PlaceHolder runat="server">
       
                    
            <%: Scripts.Render("~/Scripts/Lib") %>    
           <%: Styles.Render("~/Styles") %> 
       
         
         <script src="http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>

    </asp:PlaceHolder>

Still grid is shrinked, but I got language right. And icons beside Column are not showing.
I gess I'm missing some css class.


SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team August 18, 2016 11:30 AM UTC

Hi Hrvoje, 

We are able to reproduce the problem at our end with the given code example. 

You have bundled the ej.theme.css and ej.web.all.min.css i.e. one from minified and another one from unminified. So we suggest to use the either minified/unminified CSS throughout the application. Moreover, ej.web.all.min.css refers the ej.theme.min.css and ej.widgets.core.min.css. So in your application, theme has been loaded with the Grid data but ej.widget.core.min.css is not loaded which is the cause of the problem. So we suggest to use the following code example to load theme as well as core file. 

 
        bundles.Add(New StyleBundle("~/Styles").Include( 
         "~/Content/ej/flat-saffron/ej.theme.min.css", 
         "~/Content/ej/ej.widgets.core.min.css" 
         )) 

We have prepared a sample that can be downloaded from the following location. 


Regards, 
Seeni Sakthi Kumar S. 



HV Hrvoje Voda August 18, 2016 12:06 PM UTC

 I tried your code but it doesnt work.
I still can't see arrow icons for paging and columns.


HV Hrvoje Voda August 19, 2016 06:20 AM UTC

I manage to get it to work.
I added this in my Bundle file:

 bundles.Add(New StyleBundle("~/bundles/StylesSyncfusion").Include(
                        "~/_COMMON/Styles/ej/flat-saffron/ej.widgets.all.min.css", New CssRewriteUrlTransform()))


But when I publish it it doesn't work.
Is there anything that needs to be added for publish site?


SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team August 19, 2016 01:03 PM UTC

Hi Hrvjoe, 

To resolve the dependency errors for the images, you can use the CssRewriteUrlTransform. In Visual Studio, by default, some font files are not including during Publish. To overcome this, use the mimeMap in the web.config under the following section. 

<system.webServer> 
    <staticContent> 
      <mimeMap fileExtension="woff" mimeType="application/font-woff" /> 
      <mimeMap fileExtension="ttf" mimeType="application/font-ttf" /> 
      <mimeMap fileExtension="eot" mimeType="application/font-eot" /> 
      <mimeMap fileExtension="cur" mimeType="application/font-cur" /> 
      <mimeMap fileExtension="png" mimeType="application/font-png" /> 
 
    </staticContent> 
</system.webServer> 


Refer to the following link: 


Regards, 
Seeni Sakthi Kumar S. 


Loader.
Up arrow icon