Jump to content

Possibility to translate timepicker addon on datepicker


apeisa
 Share

Recommended Posts

  • 2 months later...

It's easy to translate jquery ui datepicker (change url to translation file from language pack), but is the same possible for timepicker addon?

Sounds easy. But for a PW newb like me, how would I go about changing that URL?

Talking about datepicker in frontend form built with fabulous FormBuilder module.

Cheers

gerhard

Link to comment
Share on other sites

@gebeer: you need to translate /wire/modules/Inputfield/InputfieldDatetime/InputfieldDatetime.module file via Setup > Languages, i.e. the built-in multi-language support. Once you start translating that file, insert the datepicker translation file you wish to use into the first input titled "Datepicker translation file."

You can see a list of available translation files here: https://github.com/ryancramerdesign/ProcessWire/tree/master/wire/modules/Jquery/JqueryUI/i18n. To get german translations, you'd insert "/wire/modules/Jquery/JqueryUI/i18n/jquery.ui.datepicker-de.js" etc.

  • Like 2
Link to comment
Share on other sites

@ryan: timepicker seems to support translation system identical to datepicker. Is there a chance that you could somehow include it's i18n files (in jQuery UI i18n directory or with the inputfield module itself) and ability to load selected one (perhaps in same way as with datepicker) at some point?

Link to comment
Share on other sites

  • 2 weeks later...
@ryan: timepicker seems to support translation system identical to datepicker. Is there a chance that you could somehow include it's i18n files (in jQuery UI i18n directory or with the inputfield module itself) and ability to load selected one (perhaps in same way as with datepicker) at some point?

Yes, I'd be happy to do this. I didn't realize it was that simple. I've got some other things on the to-do list first, so if anyone gets to it before I do feel free to send over the files and I'll add them when I get back in the office next week. 

Link to comment
Share on other sites

  • 1 year later...

Translation Problems

  • Path of 'Datepicker translation file' is set in translation file (json) of inputfield DateTime.
  • File (/wire/modules/Jquery/JqueryUI/i18n/jquery.ui.datepicker-de.js) exist and is accesible.
  • cache cleaned
  • Datepicker still uses default regional settings ???

Need help, any ideas?

# Edit 23.04.2015
Problem solved, edited jquery translation by adding timepicker regional settings. (/wire/modules/Jquery/JqueryUI/i18n/jquery.ui.datepicker-de.js). Example below (german)

/* German initialisation for the jQuery UI date picker plugin. */
/* Written by Milian Wolff (mail@milianw.de). */
/* edited by kixe: timepicker settings added 23.04.2015 */
jQuery(function($){
    $.datepicker.regional['de'] = {
        closeText: 'schließen',
        prevText: '<zurück',
        nextText: 'Vor>',
        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: 1,
        isRTL: false,
        showMonthAfterYear: false,
        yearSuffix: ''};
    $.datepicker.setDefaults($.datepicker.regional['de']);
    
    
    $.timepicker.regional['de'] = {
        timeText: 'Uhrzeit',
        hourText: 'Stunde',
        minuteText: 'Мinute',
        secondText: 'Sekunde',
        millisecText: 'Millisekunde',
        timezoneText: 'Zeitzone',
        currentText: 'jetzt',
        closeText: 'schließen',
        timeFormat: 'HH:mm',
        isRTL: false
    };
    $.timepicker.setDefaults($.timepicker.regional['de']);
});
Edited by kixe
  • Like 1
Link to comment
Share on other sites

  • 5 years later...

Seems that things changed slightly ? 

This worked for me today:

  • Translate file /wire/modules/Inputfield/InputfieldDatetime/types/InputfieldDatetimeText.php
  • Set path: /wire/modules/Jquery/JqueryUI/i18n/jquery.ui.datepicker-de.js

Search keys: datetime, date picker, monday, translate, sunday, german

  • Like 7
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...