Jquery datepicker德语

时间:2015-07-07 20:26:35

标签: javascript jquery jquery-ui translation

我现在已经实现了Jquery-UI,它运行正常,但我希望全部使用德语,例如datepicker。

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

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

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

Sub TReeTestShort()
Dim RootVar As cTree
Dim ClassLoader As cTree
Dim Key As Variant

Set RootVar = New cTree
RootVar.InitDictOnly
With RootVar
    Set ClassLoader = New cTree
    .Dict.Add 1, ClassLoader.InitBranch("2008/02/02")
    .Dict.Add 2, ClassLoader.InitBranch("2008/03/03")
    .Dict.Add 3, ClassLoader.InitBranch("2008/04/04")
    Debug.Print RootVar.Dict(1).Branch ' Prints 2008/04/04 instead of 2008/02/02
    With RootVar.Dict(1)
        Set ClassLoader = New cTree
        .Dict.Add 1, ClassLoader.InitLeave("SOL")
        Debug.Print .Dict(1).Leave
            With RootVar.Dict(1).Dict(1)
                Set ClassLoader = New cTree
                .Dict.Add 1, ClassLoader.InitBranch("EY50")
                Debug.Print .Dict(1).Branch
            End With
    End With
End With

For Each Key In RootVar.Dict()
    Debug.Print RootVar.Dict(Key).Branch
Next Key

End Sub

我怎样才能将这些东西送到德国?

2 个答案:

答案 0 :(得分:2)

只需包含正确的language.js

- &GT; https://github.com/jquery/jquery-ui/tree/master/ui/i18n

德语: - &GT; https://raw.githubusercontent.com/jquery/jquery-ui/master/ui/i18n/datepicker-de.js

然后调用这种语言:

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

答案 1 :(得分:0)

如果你想要包括所有内容的另一个选择

$(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' />