From 5d26edf0a0510b6d4d28f3359fd58dff2aa3e8da Mon Sep 17 00:00:00 2001 From: sarehag Date: Sat, 27 Feb 2016 12:30:46 +0100 Subject: [PATCH] CRM-17508:jquery datepicker doesn't inherit CMS language --- CRM/Core/Resources.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index b3f41b74fb..0f4f02b134 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -603,8 +603,9 @@ class CRM_Core_Resources { } } + global $tsLocale; // Dynamic localization script - $this->addScriptUrl(CRM_Utils_System::url('civicrm/ajax/l10n-js/' . $config->lcMessages, array('r' => $this->getCacheCode())), $jsWeight++, $region); + $this->addScriptUrl(CRM_Utils_System::url('civicrm/ajax/l10n-js/' . $tsLocale, array('r' => $this->getCacheCode())), $jsWeight++, $region); // Add global settings $settings = array( @@ -751,13 +752,14 @@ class CRM_Core_Resources { if (CRM_Core_Permission::check('administer CiviCRM') && $this->ajaxPopupsEnabled) { $items[] = "js/crm.optionEdit.js"; } - + + global $tsLocale; // Add localized jQuery UI files - if ($config->lcMessages && $config->lcMessages != 'en_US') { + if ($tsLocale && $tsLocale != 'en_US') { // Search for i18n file in order of specificity (try fr-CA, then fr) - list($lang) = explode('_', $config->lcMessages); + list($lang) = explode('_', $tsLocale); $path = "bower_components/jquery-ui/ui/i18n"; - foreach (array(str_replace('_', '-', $config->lcMessages), $lang) as $language) { + foreach (array(str_replace('_', '-', $tsLocale), $lang) as $language) { $localizationFile = "$path/datepicker-{$language}.js"; if ($this->getPath('civicrm', $localizationFile)) { $items[] = $localizationFile; -- 2.25.1