I have performed several modifications to the UI of a web application I am maintaining. These include fetching JS libraries from NuGet and aligning them to a more recent version than the previous.
The old version, running jQuery 1.8.2 and jQuery UI 1.8.24 (customized, minified, re-beautified by Firebug and shown to you) runs a perfectly localized DatePicker
, including format dd/MM/yyyy
which is the format of data wired into the text boxes by MVC pages.
Now I have fetched jQuery 1.11.2 and jQuery UI 1.11.2, presuming that everything will continue to work as expected.
Nope.
The DatePicker are still initialized as follows:
<script type="text/javascript">
$(function() {
$.datepicker.setDefaults($.extend({ showMonthAfterYear: false }, $.datepicker.regional['']));
$(".datePicker").datepicker($.datepicker.regional['it']);
$('.datePicker').datepicker('option', 'changeMonth', true);
$('.datePicker').datepicker('option', 'changeYear', true);
$("#locale").change(function() {
$('.datePicker').datepicker('option', $.extend({ showMonthAfterYear: false },
$.datepicker.regional[$(this).val()]));
});
});
</script>
And the textboxes are
<input type="text" class="datePicker" id="date_begin" name="pDateBegin" value="<%=Some.Data %>" readonly="readonly"/>
<input type="text" class="datePicker" id="date_end" name="pDateEnd" value="<%=Some.Data %>" readonly="readonly"/>
Briefly, the old application shows a well-localized calendar and accepts dd/MM/yyyy
dates. The new refactored application doesn't obviously accept dates as 24/02/2015
as valid dates, leaving the textbox blank. And that version shows an English localized calendar while the JS code requires it
regional. From Firebug console on the old application I can see the value of $.datepicker.regional['it']
correctly, and it's empty in the new application.
I wanted to track down, to solve the problem myself, where in the code the IT regional is defined, but searching for Chiudi
(it message for "Close") doesn't find anything. It looks like the language comes from the mistery.
The old application includes the following files (in Firebug's order):
- jquery.form.js
- jquery-1.8.2-min.js
- jquery-ui-1.8.24.custom.min.js (linked in the paste, no result for the magic word Chiudi)
- superfish.js
- Custom app's JS scripts (included in the new application and not overriding datepicker anyway)
- MicrosoftAjax.js
- MicrosoftMVC.js
- jquery.tablesorter.js
- jquery.tablesorter.pager.js
An override of datepicker's regional is not even found in the ASPX code, which I haven't changed yet in the page I'm examining.
The question is
How to add languages to the standard NuGet distribution of jQuery UI?