Okay
  Public Ticket #1939778
localisation
Closed

Comments

  • Hubert_Hilling started the conversation

    i have problems to translate the every elemet that concerns to teh date time picker.

    i need it in German version. In the option it is set to german language.I translated the po-file and read teh info for internationalisation but i do not know where to enter the code.

    Plaes give a littele help

  •  2,572
    Aleksandar replied

    Hello Hubert.

    Thank you for your purchase.

    There's no built-in option to translate the date picker to German, but here's a workaround:

    1. Open ../wp-content/plugins/wpdatatables/assets/js/wpdatatables/wdt.funcs.js and add this code under the comments "Apply datetimepicker" around line 147:

    moment.locale('de', {
            months : ["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],
            monthsShort : ["jan", "feb", "mär", "apr", "mai", "jun", "jul", "aug", "sep", "okt", "nov", "dec"],
            weekdaysMin : ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
            week : {        dow : 1 // Monday is the first day of the week
            }});
    

    Then, below that find this line of code:

    $(this).datetimepicker(
                {
                    format: wdtDateFormat,
                    showClear: true,
                    keepOpen: true,
                    useCurrent: false
                }
            )
    

    And modify it to look like this (add "locale: 'de' "):

    $(this).datetimepicker(
                {
                    format: wdtDateFormat,
                    showClear: true,
                    keepOpen: true,
                    useCurrent: false,
                    locale: 'de'
                }
            )

    Then, do the same for around line 190 (add "locale: 'de' "):

    $(this).datetimepicker(
                {
                    format: wdtDateFormat,
                    showClear: true,
                    keepOpen: true,
                    useCurrent: false,
                    locale: 'de'
                }
            )
                .off('dp.show')
                .on('dp.show', function () {
                    $(this).parent().find('div.bootstrap-datetimepicker-widget').addClass('wdt-datetimepicker-modal');
                    if (!_.contains(['MM/Y','MMM Y','Y'], wdtDateFormat)) {
                        wdtAddDatePlaceholders($(this));
                    }
                });
        });

    Do not forget to add a comma ( , ) after " useCurrent: false " (see code above). If you forget that, this will not work.

    2. Open ../wp-content/plugins/wpdatatables/source/class.wdttools.php and around line 920 add the following line of code:

    wp_enqueue_script('wdt-moment', WDT_JS_PATH . 'moment/locale/de.js', array(), false, true);
    

    So it should look like this in the end:

    wp_enqueue_script('wdt-moment', WDT_JS_PATH . 'moment/moment.js', array(), WDT_CURRENT_VERSION, true);
    wp_enqueue_script('wdt-moment', WDT_JS_PATH . 'moment/locale/de.js', array(), false, true);
    wp_enqueue_script('wdt-bootstrap-datetimepicker', WDT_JS_PATH . 'bootstrap/bootstrap-datetimepicker/

    This also changes the datepicker starting day, so the week starts from Monday, not Sunday.

    Please let me know if this helps.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Hubert_Hilling replied

    hey Aleksandar,

    i am sorry but it was not successful. I changed the 2 files as demanded. I attach the the files changed.PHP version 7.2.15, MySQL Version 5.6.42
    Interface language German

    In the datetimepicker the word 'from' and 'to ' should also be changed too.

    Do you have any idea?


    Thanks for your help.

    Salutations Hubert




  •  2,572
    Aleksandar replied

    Hi Hubert.

    You seem to have added this one too many times in wdt.funcs.js:

    moment.locale('de', {
            months : ["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],
            monthsShort : ["jan", "feb", "mär", "apr", "mai", "jun", "jul", "aug", "sep", "okt", "nov", "dec"],
            weekdaysMin : ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
            week : {        dow : 1 // Monday is the first day of the week
            }});
    

    The class.wdttools.php is good, so please try with the attached .js file.

    As for "From" and "To", please paste this line of code in class.wdttools.php, at line 359:

    from'                      => __('Von', 'wpdatatables'),
    

    And at line 403:

    'to'                        => __('Zu', 'wpdatatables')
    

    It won't let me upload the .php file as an attachment, otherwise I would have provided that as well.

    Please let me know if this works.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Hubert_Hilling replied

    'From' and 'to'  is ok,

    Datapicker no changes…

    https://www.caso.de/test100/

    Salutations Hubert

  • Hubert_Hilling replied

    now it works. i am happy.  cache problem? The one think i remarked is that the month MÄRZ the 'Ä' does not appaer correct.

    In idea for?


    Salutations Hubert


  •  2,572
    Aleksandar replied

    Honestly, Hubert, I don't know why it won't work on your end.

    See how it looks in my local environment:

    9860508463.png

    Can you, please provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party. You can write credentials here just check Private Reply so nobody can see them except us.

    Also, please make sure the Plugin Editor is available from the Dashboard, so I can take a look at the files.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •   Hubert_Hilling replied privately
  •  2,572
    Aleksandar replied

    Hi Hubert.

    Yeah, that was my bad. Sorry.

    I forgot to tell you about one more line of code:

    In ../wp-content/plugins/wpdatatables/assets/js/wpdatatables/wdt.frontend.min.js I found this line:

    $(this).datetimepicker({format:wdtDateFormat,showClear:!0,keepOpen:!0,useCurrent:!1})
    

    It is a minified file, so you can only search through it. Then, I added " locale: 'de' ":

    $(this).datetimepicker({format:wdtDateFormat,showClear:!0,keepOpen:!0,useCurrent:!1,locale:'de'})

    And then, I had to disable the "Use minified wpDataTables Javascript" slider located in main settings of wpDataTables, under Custom JS and CSS tab:

    1040150707.png

    Now it works in front-end as well. I also changed "Maerz" to "März", so I believe we got it covered completely.

    Please take a look and let me know if everything looks good.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Hubert_Hilling replied

    Hallo Aleksandar,

    now i am absolutly glade. Thanks for your professional support.

    Super tool for me as a simple solution.

    Gratulations

    Hubert



  •  2,572
    Aleksandar replied

    Thank you, Hubert, and you're welcome!

    I'm glad I could be of service.

    If you have any more issues or questions feel free to open a new ticket, we will gladly help.

    We'd greatly appreciate it if you could take a minute and leave a Review on CodeCanyon on this link. Thanks! 

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •   Aleksandar replied privately