Hello,
Firstable, thank you for the support and all the tutorials.
I have a problem with Ignite UI 2012.2 IgGrid for ASP.net MVC4 Razor, i´m not able to load the js resources for my Language Spanish.
I´m Following all the tutorials but unfortunately i dont achieve any results.
I´m doing the tutorials step by step, and actually i dont know if i´m missing something.
thanks in advance,
David Alonso.
Hello David,
The easiest way to enable localization is to use the Infragistics Loader.
When you use the Infragistics Loader you have 2 options:
-To set the locale explicitly by setting the locale property of the loader. Here is an example code:
@(Html.Infragistics() .Loader() .ScriptPath(Url.Content("http://cdn-na.infragistics.com/jquery/20122/latest/js/")) .CssPath(Url.Content("http://cdn-na.infragistics.com/jquery/20122/latest/css/")) .Locale("es") .Render())
-To let the loader pick the correct locale based on the browser/OS regional settings by setting the autoDetectLocale option of the loader. Unfortunately the loader MVC wrapper is lacking that option, thus I've logged an internal bug (143955) which will be resolved with the next service release. In order to overcome this you should instantiate the loader in JavaScript directly. Here is an example code:
@(Html.Infragistics().Loader().Render()) //this line of code is needed in order to overcome bug 143955
$.ig.loader({ scriptPath: "http://cdn-na.infragistics.com/jquery/20122/latest/js/", cssPath: "http://cdn-na.infragistics.com/jquery/20122/latest/css/", resources: "igGrid.Paging", autoDetectLocale: true});
In case you don't use Infragistics Loader you have to manually include the *-es.js files from \js\modules\i18n folder.
Hope this helps,Martin PavlovInfragistics, Inc.
Hello Martin,
thank you for your quick support.
I have two doubts.
This line of code
@(Html.Infragistics().Loader().Render())
Where i have to place it?
I have a LayoutPrincipal whit sections, in one section @renderBody which load the partial view where it´s the IgGrid.
And with
scriptPath: "http://cdn-na.infragistics.com/jquery/20122/latest/js/",cssPath: "http://cdn-na.infragistics.com/jquery/20122/latest/css/",
you mean the source of the field wich contains ~/Scripts/jQuery/Common/js/i18n/infragistics.ui.grid-es.js" this field contains also the fields extensions, i18n, modules and the scripts infragistics.js,infragistics.loader.debug.js and infragistics.loader.js.
Sorry for this cuestions, but i have tried to achieve the localization many times and i dont want to make a mistake.
My best regards and congratulation for your job.
To achieve the culture change also in the IgGrid i made a especific cookie
Dim Culture As HttpCookie = New HttpCookie("culturename")
Culture.Value = cultureName.Substring(0, cultureName.IndexOf("-"))
with the new culture and load in the script
$.ig.loader({ scriptPath: "/Scripts/jQuery/Common/js/", cssPath: "/Scripts/jQuery/Common/css/", resources: "igGrid.Paging", locale: $.cookie("culturename")});
but the calendar in the filtering isn´t chaging.
The calendar was always in English, never changed.
Regards in advance.
The igDatePicker control is based on the jQuery UI Datepicker control. In order to localize the date picker control you should go to the jQuery UI site and download the Datepicker control. In the bundle there are localization files.
You should include the localization files which you want to support in your page.
Then you have to call the following function:
$.datepicker.setDefaults($.datepicker.regional["es"]);
where "es" is the locale in your cookie.
I'm attaching a sample project which demonstrates this.
Thank you again for your support.
Now the dataPicker is in Spanish, but only in Spanish it doesn´t change to defautl.
Should i load a localization file for English?
There are only for GB, NZ and AU not US.
You don't have to load a localization file for English explicitly.
Try to use the following code in order to reset the locale back to English:
$.datepicker.setDefaults($.datepicker.regional[""]);
it´s seems to work properly with this line of code and it change the culture too, Spanish and English.
I don´t understand it really good but it´s works.
Thank you so much for your support.
Really good job.