3

I have a site that is translated into two languages; English and Turkish. I want the datepicker on this turkish page to display the datepicker UI in the Turkish Language and not the default English Language. Clearly simply using two different forms does not solve the problem. I have tried solutions from this, this and even the demo page but I still get errors. So either I am applying them wrongly or am missing something. I even included the language source code from the jQuery CDN, downloaded a copy to the server but still the results are not positive. Below is the current code, it gives no errors as it is now but it still does not work.

In The Contact Form:

    <tr><td>Tarih</td><td>:</td><td>[date* tarih id:tarih]</td></tr>

The CSS head tag for the page.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script data-require="jqueryui@*" data-semver="1.10.0" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.9.2/i18n/jquery.ui.datepicker-tr.min.js"></script>
<link data-require="jqueryui@*" data-semver="1.10.0" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.0/css/smoothness/jquery-ui-1.10.0.custom.min.css" />
<script data-require="jqueryui@*" data-semver="1.10.0" src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.0/jquery-ui.js"></script>

The Javascript

<script type="text/javascript">
    $(document).ready(function() {
      var options = $.extend(
        {},                                  
        $.datepicker.regional["tr"], 
        { dateFormat: "dd.mm.yy" } 
        );
        $.datepicker.setDefaults(options);
    });
  </script>
Community
  • 1
  • 1
gordon
  • 191
  • 1
  • 2
  • 12
  • 1
    modern broswers render datepicker direclty. Have you tried changing your browser language to see if the date picker shows up correctly? – Aurovrata Aug 03 '19 at 13:20
  • 1
    wow. you are right. it was directly reading it from the the system language. Thanks. can u convert this to an answer. – gordon Sep 23 '19 at 10:27

1 Answers1

2

Modern browsers render datepicker directly. Change your browser language to render the data picker in your local language.

Aurovrata
  • 2,000
  • 27
  • 45