此行位于我的 JavaScript 之上并执行:
jQuery(function($) {
$.datepicker.setDefaults($.datepicker.regional['de']);
});
我在 document-ready 函数内的同一个文件中初始化我的日历:
// #transports-calendar is a div
$("#transports-calendar").datepicker({
onSelect: function() {
// Some stuff
}
});
在我的 HTML 页面上,包含以下脚本:
<script src="/Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-ui.js" type="text/javascript"></script>
<script src="/Scripts/jquery.unobtrusive-ajax.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery.dialogextend.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery.blockUI.js" type="text/javascript"></script>
<script src="/Scripts/jquery-ui-timepicker-addon.js" type="text/javascript"></script>
<script src="/Scripts/tooltip.js" type="text/javascript"></script>
<script src="/Scripts/tooltip.dynamic.js" type="text/javascript"></script>
<script src="/Scripts/tooltip.slide.js" type="text/javascript"></script>
<script src="/Scripts/core.js" type="text/javascript"></script>
<script src="/Scripts/core-functionality.js" type="text/javascript"></script>
<script src="/Scripts/core-extensions.js" type="text/javascript"></script>
<script src="/ModuleScripts/jquery.ui.datepicker-de.js" type="text/javascript"></script>
一切都很好,但正如标题中提到的,DatePicker 只有在单击时才会被翻译。