- This topic has 6 replies, 3 voices, and was last updated 4 years, 10 months ago by
dbsul.
-
AuthorPosts
-
November 13, 2018 at 12:01 pm #8477
dbsul
ParticipantI have created translation for greek datepicker, but trip information still show english dates. Dates are right only in booking area
November 20, 2018 at 12:18 pm #8514WP Travel
KeymasterSorry for the trouble this has caused. We are currently working on this issue. Fix will be available in 1.7.2 version.
November 30, 2018 at 10:17 am #8641dbsul
ParticipantCan 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
November 30, 2018 at 11:46 am #8642WP Travel
KeymasterHello @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!!
December 1, 2018 at 1:47 pm #8645dbsul
ParticipantThat 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
December 3, 2018 at 5:28 am #8648Support Team
KeymasterHello @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!!
December 3, 2018 at 9:19 am #8653dbsul
ParticipantUnfortunately 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? -
AuthorPosts
- The forum ‘WP Travel’ is closed to new topics and replies.