From c27775865b3614e60c4c0fe226a83b659cab9f90 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 17 Mar 2013 14:53:26 -0700 Subject: [PATCH] Load country-specific calendar i18n if available --- CRM/Core/Resources.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index c008438b01..629f0c3df0 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -433,14 +433,18 @@ class CRM_Core_Resources { } // Add localized calendar js + // Search for i18n file in order of specificity (try fr-CA, then fr) list($lang) = explode('_', $config->lcMessages); - $localizationFile = "packages/jquery/jquery-ui-1.9.0/development-bundle/ui/i18n/jquery.ui.datepicker-{$lang}.js"; - if ($this->getPath('civicrm', $localizationFile)) { - $this->addScriptFile('civicrm', $localizationFile, $jsWeight++, $region, FALSE); + foreach (array(str_replace('_', '-', $config->lcMessages), $lang) as $language) { + $localizationFile = "packages/jquery/jquery-ui-1.9.0/development-bundle/ui/i18n/jquery.ui.datepicker-{$language}.js"; + if ($this->getPath('civicrm', $localizationFile)) { + $this->addScriptFile('civicrm', $localizationFile, $jsWeight++, $region, FALSE); + break; + } } // Give control of jQuery back to the CMS - this loads last - $this->addScriptFile('civicrm', 'js/noconflict.js', 9999, $region); + $this->addScriptFile('civicrm', 'js/noconflict.js', 9999, $region, FALSE); $this->addCoreStyles($region); } -- 2.25.1