Support » Plugin: CMB2 » Datepicker Turkish Translation

  • Resolved burhanilme

    (@burhanilme)


    I want to translate the day and month names in the Datepicker Fields into Turkish.I also want to translate the explanations in the hour and minute sections to Turkish. But I couldn’t do it. Moreover, although there is a Turkish translation file in the translation section in your plugin, the names of the day and month still come in English. I hope you can help.

    $.datepicker.regional['tr'] = {
    		closeText: 'kapat',
    		prevText: 'geri',
    		nextText: 'ileri',
    		currentText: 'bugün',
    		monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran',
    		'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'],
    		monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz',
    		'Tem','Ağu','Eyl','Eki','Kas','Ara'],
    		dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'],
    		dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
    		dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
    		weekHeader: 'Hf',
    		dateFormat: 'dd.mm.yy',
    		firstDay: 1,
    		isRTL: false,
    		showMonthAfterYear: false,
    		yearSuffix: ''};

    If the code we wrote is correct, can you tell me where to add it?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Unless mistaken, you’ll need to use the cmb2_localized_data filter found in includes/CMB2_JS.php to get the datepicker values localized outside of the provided po/mo files.

    Alternatively, there’s simply chance that the current po/mo files are outdated and could use a refresh, allowing them to be used properly instead.

    Plugin Author Justin Sternberg

    (@jtsternberg)

    There is an example for overriding the datepicker defaults for a given field in the wiki: https://github.com/CMB2/CMB2/wiki/Field-Types#jquery-ui-option-example-usage

    Using the filter is not a bad idea if you know you want to affect all instances of the CMB2 datepicker (even those which may be bundled in other plugins or the theme).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Datepicker Turkish Translation’ is closed to new replies.