Hi,
I can't localize my igGrid. The code below is my partialView. Any Idea why it doesn't work ?
@using Infragistics.Web.Mvc;
@model IQueryable<Terminal>
@(Html.Infragistics().Loader().Render())
// $.ig.loader({ scriptPath: "http://cdn-na.infragistics.com/jquery/20122/latest/js/", cssPath: "http://cdn-na.infragistics.com/jquery/20122/latest/css/", resources: "igGrid.*", autoDetectLocale:true });
// ]]>
@( Html.Infragistics().Grid(Model) .ID("GridResearchTerminal") .Width("100%") .Height("500px") .PrimaryKey("Id") .AutoGenerateColumns(false) .AutoGenerateLayouts(false) .Columns(column => { column.For(x => x.Reference).HeaderText("Reference").Width("20%"); column.For(x => x.Brand).HeaderText("Brand").Width("20%"); column.For(x => x.Model).HeaderText("Model").Width("20%"); column.For(x => x.PhoneNumber).HeaderText("PhoneNumber").Width("40%"); }) .Features(features => { features.Selection() .Mode(SelectionMode.Row) .MultipleSelection(false) .AddClientEvent("rowSelectionChanged", "onRowTerminalSelectionChanged"); features.Sorting().Type(OpType.Remote); features.Paging().Type(OpType.Remote); features.Filtering() .Type(OpType.Remote) .Mode(FilterMode.Advanced) .ShowNullConditions(true) .ShowEmptyConditions(true); features.ColumnMoving(); features.Resizing(); }) .LoadOnDemand(true) .AutofitLastColumn(true) .MergeUnboundColumns(true) .DataSourceUrl(Url.Action("GetTerminal")) .Render())
Hello,
Welcome to the community!
In general, the loader can automatically detect the language of the browser’s UI and switch to this locale. It is controlled by the autoDetectLocaleoption, which is set to false by default. If autoDetectLocale is set and locale is set, the locale option takes precedence.
So the relevant question is what is the language of the browser’s UI?
I believe you will find the following guide upon Customizing the Localization of Ignite UI Controls will help you achieve this.
http://help.infragistics.com/Help/Doc/jQuery/2014.2/CLR4.0/html/Customizing_the_localization_of_NetAdvantage_for_jQuery_controls.html Referencing localization resources using the Infragistics Loader:
http://help.infragistics.com/Help/Doc/jQuery/2014.2/CLR4.0/html/Using_Infragistics_Loader.html#_Ref322448609
Thank you Ivaylo for your answer.
I have seen the tutorial, that's why i'm trying to localize with the loader.
are my scriptPath and cssPath OK ?
scriptPath: "http://cdn-na.infragistics.com/jquery/20122/latest/js/",cssPath: "http://cdn-na.infragistics.com/jquery/20122/latest/css/",
I want to translate the grid in french, my browser language is in french. But nothing happens.
Can you provide me a simple example with igGrid localization with loader ? I'm using razor like my first post example.
Ok Martin thank you. You can close the thread.
Hello Nicolas,
The reason is that they are excluding each other. If you're using the Infragistics Loader then you should not reference the infragistics.core.js, infragistics.dv.js and infragistics.lob.js and vice versa.
Best regards,Martin PavlovInfragistics, Inc.
Now my question is why if I add infragistics.core.js, infragistics.dv.js and infragistics.lob.js the loader doesn't work ?
Hi Martin,
I'm sorry to answer late. Indeed i looked one of your old posts that's why I mixed Razor and JavaScript Loader, my mistake. Now i'm using just the razor. And I used 3 js files (infragistics.core.js, infragistics.dv.js, infragistics.lob.js) that created the conflict with infragistics.loader.js. So i deleted them and now it works.
I tested the loader with autoDetectLocale option set to true and it works on my side. Note that the loader uses the navigator.language of the browser and in order to work as expected the browser navigator.language should be "fr" in your case.
I'm attaching my sample for your reference.
I'm wondering why are you mixing Razor initialized loader and JavaScript loader? Maybe that's the reason for your problem.
The other cause can be the language settings of your browser. The French should be on top of the list. For example on Chrome you can open the language settings using the following Url: chrome://settings/languages#language
Hope this helps,
Martin Pavlov Infragistics, Inc.