Datepicker translation

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #8477
    dbsul
    Participant

    I have created translation for greek datepicker, but trip information still show english dates. Dates are right only in booking area

    #8514
    WP Travel
    Keymaster

    @dbsul,

    Sorry for the trouble this has caused. We are currently working on this issue. Fix will be available in 1.7.2 version.

    #8641
    dbsul
    Participant

    Can you please explain me. I have set website language as greek. All dates are still in English except dates in Booking Tab”. I have made same test with french and I face same problem. Is there any way to change language to dates?

    Thanks a lot

    #8642
    WP Travel
    Keymaster

    Hello @dbsul,

    For the translation of the date picker in your language, you need to add the js file for the Greek language by going to your wp-content > languages > wp-travel > datepicker.

    For translation, you just have to create the JS file pasting the JS code naming it “datepicker.en.js”. Here just replace the “en” locale to your language locale.

    Below is the block of JS code that you have to add inside datepicker creating a file naming it to “datepicker.el.js”.

    ;(function ($) {
        var translation = {
            days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
            daysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
            daysMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
            months: ['January','February','March','April','May','June', 'July','August','September','October','November','December'],
            monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
            today: 'Today',
            clear: 'Clear',
            dateFormat: 'mm/dd/yyyy',
            timeFormat: 'hh:ii aa',
            firstDay: 0
        };
    
        if (typeof( $.fn.wpt_datepicker ) !== 'undefined' && $.isFunction($.fn.wpt_datepicker)) {
            $.fn.wpt_datepicker.language['en'] = translation;
        } else if (typeof( $.fn.datepicker ) !== 'undefined' && $.isFunction($.fn.datepicker)) {
            $.fn.datepicker.language['en'] = translation;
        }
    
    })(jQuery);

    Here replace the Locale “en” and replace days, months in your language.

    Hope this helps.

    Regards!!

    #8645
    dbsul
    Participant

    That did not work
    I have created a folder with name “wp-travel” inside wp-content > languages > .
    Then I have cretaed an extra folder with name “datepicker” because destination is empty.
    Inside this folder, I have created the “datepicker.el.js” including this coce

    ;(function ($) {
        var translation = {
            days: ['Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'],
            daysShort: ['Κυρ', 'Δευτ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ'],
            daysMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
            months: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος', 'Ιούλιος','Αύγουστος','Σεμπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'],
            monthsShort: ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαι', 'Ιουν', 'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'],
            today: 'Σήμερα',
            clear: 'Clear',
            dateFormat: 'mm/dd/yyyy',
            timeFormat: 'hh:ii aa',
            firstDay: 0
        };
    
        if (typeof( $.fn.wpt_datepicker ) !== 'undefined' && $.isFunction($.fn.wpt_datepicker)) {
            $.fn.wpt_datepicker.language['el'] = translation;
        } else if (typeof( $.fn.datepicker ) !== 'undefined' && $.isFunction($.fn.datepicker)) {
            $.fn.datepicker.language['el'] = translation;
        }
    
    })(jQuery);

    But,still nothing. Everything is in english language

    #8648
    Support Team
    Keymaster

    Hello @dbsul,

    The code that you have used works only expect in the “SU, MU etc” part and it is because you have not added translated text for this.

    Example:

    Here: daysMin: [‘Su’, ‘Mo’, ‘Tu’, ‘We’, ‘Th’, ‘Fr’, ‘Sa’], add the translated version of “Su, mu” in your language in above code.

    Hope this helps.

    Regards!!

    #8653
    dbsul
    Participant

    Unfortunately translation does not work. Unless there is another step that is not mentioned.
    I tried to translate the Plugin into French,too, with the file attached and all the dates of the trip appeared also in English.
    Should the .js file be invoked in another folder in the Plugin and not in wp-content>languages? Or should I also state the language of the site somewhere else and not just in the wordpress settings?

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘WP Travel’ is closed to new topics and replies.