Jquery 日期选择器德语

Jquery datepicker german

我现在已经实现了 Jquery-UI,它运行良好,但我想全部使用德语,例如日期选择器。

我已经尝试更改 jquery-ui.js 中的字符串:

this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
this.regional = []; // Available regional settings, indexed by language code
this.regional[""] = { // Default regional settings
    closeText: "Done", // Display text for close link
    prevText: "Prev", // Display text for previous month link
    nextText: "Next", // Display text for next month link
    currentText: "Today", // Display text for current month link
    monthNames: ["Januar","Februar","März","April","Mai","Juni",
        "Juli","August","September","Oktober","November","Dezember"], // Names of months for drop-down and formatting
    monthNamesShort: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], // For formatting
    dayNames: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Dienstag", "Freitag", "Samstag"], // For formatting
    dayNamesShort: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], // For formatting
    dayNamesMin: ["So","Mo","Di","Mi","Do","Fr","Sa"], // Column headings for days starting at Sunday
    weekHeader: "KW", // Column header for week of the year
    dateFormat: "dd.mm.yy", // See format options on parseDate
    firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
    isRTL: false, // True if right-to-left language, false if left-to-right
    showMonthAfterYear: false, // True if the year select precedes month, false for month then year
    yearSuffix: "" // Additional text to append to the year in the month headers
};

这没有用,所以我尝试将脚本插入 index.php:

<script>$.datepicker.setDefaults($.datepicker.regional['de']);</script>

我怎样才能把这些东西变成德语?

只包括右边的language.js

-> https://github.com/jquery/jquery-ui/tree/master/ui/i18n

对于德语: -> https://raw.githubusercontent.com/jquery/jquery-ui/master/ui/i18n/datepicker-de.js

然后调用此语言:

$( selector ).datepicker( $.datepicker.regional[ "de" ] )

另一种选择,如果你想要一切都包括在内

$(function() {
    $.datepicker.regional['de'] = {
  closeText: 'Done',
  prevText: 'Prev',
  nextText: 'Next',
  currentText: 'heute',
  monthNames: ['Januar','Februar','März','April','Mai','Juni',
  'Juli','August','September','Oktober','November','Dezember'],
  monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
  'Jul','Aug','Sep','Okt','Nov','Dez'],
  dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
  dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
  dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
  weekHeader: 'KW',
  dateFormat: 'dd.mm.yy',
  firstDay: 0,
  isRTL: false,
  showMonthAfterYear: false,
  yearSuffix: ''};
        $("#StartDate").datepicker( $.datepicker.regional[ "de" ] );
        $('#StartDate').datepicker('option', 'dateFormat', 'yy-mm-dd');
    });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"></link>
<input type='text' id='StartDate' />