5.7 External form with date picker - calendar not translated

Permalink
Hi folks,

I need to have an external form with a date picker (for the birth date).
The site is in French and German.
Everything works fine (translation done through t('english_string') and the "Translate Site Interface") except the fact the date picker pop-up is not translated (it stays in English) with no way to change it.

I use the following code:
$form = Loader::helper('form');
$dtt = Loader::helper('form/date_time');
//...
echo $dtt->date('a_birthdate', "1/1/2000", true);


which writes:
<div>
 <span class="ccm-input-date-wrapper" id="a_birthdate_dw">
  <input id="a_birthdate_pub" class="form-control ccm-input-date hasDatepicker">
  <input id="a_birthdate" name="a_birthdate" type="hidden" value="2000-01-01">
 </span>
</div>
<script type="text/javascript">
$(function () {
 $("#a_birthdate_pub").datepicker({
  dateFormat: "d\/m\/yy",
  altFormat: "yy-mm-dd",
  altField: "#a_birthdate",
  changeYear: true,
  showAnim: 'fadeIn'
 }).datepicker( "setDate" , new Date(2000, 0, 1) ); });


What is the best way to pass the language parameter?
Thanks in advance for you lights on it!
Marc

1 Attachment

swissmovie
 
A3020 replied on at Permalink Reply
A3020
Based on the active language you should include the appropriate localization file. They are located in /concrete/js/i18n/ui.datepicker-**.js.
swissmovie replied on at Permalink Reply
swissmovie
Thanks for the answer!

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.