title: JQuery datepicker language not working correctly
body: <p>I using jquery datepickers in my project and need to have local language on it.</p>
  
  <p><a href="https://i.stack.imgur.com/x6HNg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x6HNg.png" alt="enter image description here"></a></p>
  
  <p>I need to pass language from back end via <code>gon.locale</code>(rails stuff)</p>
  
  <p>So here is my ts code</p>
  
  <pre><code> const search_legs_1_datepicker = $("#search_legs_1_datepicker");
  var leg_1_datepicker = $("#search_legs_1_datepicker").datepicker({
  
    language: gon.locale,
    classes: 'inline-picker',
    altField: '#search_legs_1_date',
    defaultDate: new Date(search_legs_1_datepicker.attr("data-defaultDate")),
    minDate: new Date(search_legs_1_datepicker.attr('data-mindate')),
    maxDate: new Date(search_legs_1_datepicker.attr('data-maxdate')),
    altFormat: 'yy-mm-dd',
    onSelect: (formattedDate, date, inst) =&gt; {
      if ($("#search_legs_1_hotel_date").length &gt; 0) {
        $('#search_legs_0_hotel_date').datepicker().data('datepicker').update('maxDate', date);
        $('#search_legs_1_hotel_date').datepicker().data('datepicker').update('maxDate', date);
        $('#search_legs_1_hotel_date').datepicker().data('datepicker').datepicker("setDate", date);
      }
    }
  })
  </code></pre>
  
  <p>I checked <code>gon.locale</code> with console and get  <code>sv-SE</code> so it's pass language.</p>
  
  <p>Also I try to do it like this</p>
  
  <pre><code>language:"sv-SE"
  </code></pre>
  
  <p>It not works too.</p>
  
  <p>But for some reasons I have <code>en</code> at my datepickers.</p>
  
  <p>Where is my problem? </p>