Best practice forum (Archived)

Localisation of js datepicker on competencies (Learning Plans)

 
Rogelio Alvarez
Localisation of js datepicker on competencies (Learning Plans)
by Rogelio Alvarez - Wednesday, 29 May 2019, 1:49 PM
Group Partners

Hello,

I'm struggling with the localisation of js datepicker on the section competencies of a learning plan, even though my current language is spanish and part of the code on setup.php of datepicker states:


if (in_array(TOTARA_JS_DATEPICKER, $options)) {

$PAGE->requires->js('/totara/core/js/lib/jquery-ui-1.10.4.custom.min.js');

$PAGE->requires->strings_for_js(array('datepickerlongyeardisplayformat', 'datepickerlongyearplaceholder', 'datepickerlongyearregexjs'), 'totara_core');
$PAGE->requires->string_for_js('thisdirection', 'langconfig');

$lang = current_language();

// include datepicker localization file if present for current language
$file = "/totara/core/js/lib/i18n/jquery.ui.datepicker-{$lang}.js";
if (is_readable($CFG->dirroot . $file)) {
$PAGE->requires->js($file);
}
}

Totara is not reading this lang file: $file = "/totara/core/js/lib/i18n/jquery.ui.datepicker-{$lang}.js";

It's still taking all the strings on /totara/core/js/lib/jquery-ui-1.10.4.custom.min.js

Is there somewhere else where i need to check to ensure datepicker is correctly translated to spanish?


I would appreciate your help!


Thanks in advance,


Roger.


me
Re: Localisation of js datepicker on competencies (Learning Plans)
by George Angus - Monday, 3 June 2019, 2:12 PM
Group Totara

Hi Rogelio,

Apologies for the delay in getting back to you. Would it be possible for you to submit a Support ticket for this issue? As soon as we have it we'll ask our dev team to investigate.

cheers,

George.