下载jQuery脚本以本地化datepicker

时间:2012-03-01 09:29:15

标签: jquery asp.net-mvc asp.net-mvc-3 jquery-ui datepicker

我想在我们的MVC项目中使用jQuery datepicker localize,但我找不到语言js文件为here解释我们需要这样的文件:jquery.ui.datepicker-fr.js但是唯一的链接我可以找到this而我们在伊朗无法访问那个,是否有下载语言js文件的链接?还需要波斯语(波斯语)版本,如下所示:jquery.ui。日期选择器-fa.js

3 个答案:

答案 0 :(得分:11)

法:

/* French initialisation for the jQuery UI date picker plugin. */
/* Written by Keith Wood (kbwood{at}iinet.com.au) and Stéphane Nahmani (sholby@sholby.net). */
jQuery(function($){
    $.datepicker.regional['fr'] = {
        closeText: 'Fermer',
        prevText: '<Préc',
        nextText: 'Suiv>',
        currentText: 'Courant',
        monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
        'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
        monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
        'Jul','Aoû','Sep','Oct','Nov','Déc'],
        dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
        dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
        dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
        weekHeader: 'Sm',
        dateFormat: 'dd/mm/yy',
        firstDay: 1,
        isRTL: false,
        showMonthAfterYear: false,
        yearSuffix: ''};
    $.datepicker.setDefaults($.datepicker.regional['fr']);
});

波斯语:

/* Persian (Farsi) Translation for the jQuery UI date picker plugin. */
/* Javad Mowlanezhad -- jmowla@gmail.com */
/* Jalali calendar should supported soon! (Its implemented but I have to test it) */
jQuery(function($) {
    $.datepicker.regional['fa'] = {
        closeText: 'بستن',
        prevText: '<قبلي',
        nextText: 'بعدي>',
        currentText: 'امروز',
        monthNames: ['فروردين','ارديبهشت','خرداد','تير','مرداد','شهريور',
        'مهر','آبان','آذر','دي','بهمن','اسفند'],
        monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
        dayNames: ['يکشنبه','دوشنبه','سه‌شنبه','چهارشنبه','پنجشنبه','جمعه','شنبه'],
        dayNamesShort: ['ي','د','س','چ','پ','ج', 'ش'],
        dayNamesMin: ['ي','د','س','چ','پ','ج', 'ش'],
        weekHeader: 'هف',
        dateFormat: 'yy/mm/dd',
        firstDay: 6,
        isRTL: true,
        showMonthAfterYear: false,
        yearSuffix: ''};
    $.datepicker.setDefaults($.datepicker.regional['fa']);
});

只需将它们分别添加到文件中并根据需要命名,一切都会正常工作; - )

答案 1 :(得分:0)

也许您可以使用http://www.prosoftnearshore.com/blog/post/2011/10/31/Localizing-files-%28jpg-css-js-etc%29-in-ASPNET.aspx本地化特定文化的.js文件并结合EvilP的答案。

答案 2 :(得分:0)

这个答案在今天赢得了我的信誉。以为我会回馈。这是一个巴西葡萄牙语版本给那些有需要的人。

jQuery(function($){
    $.datepicker.regional['br'] = {
        closeText: 'close',
        prevText: 'Prev',
        nextText: 'Next',
        currentText: 'Current',
        monthNames: ['Janeiro','Fevereiro','Marco','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
        monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
        dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'],
        dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
        dayNamesMin: ['D','S','T','Q','Q','S','S'],
        weekHeader: 'D',
        dateFormat: 'mm-dd-yyyy',
        firstDay: 1,
        isRTL: false,
        showMonthAfterYear: false,
        yearSuffix: ''};
    $.datepicker.setDefaults($.datepicker.regional['br']);
});