diff --git a/module/VuFind/src/VuFind/Bootstrapper.php b/module/VuFind/src/VuFind/Bootstrapper.php index a0357003d15b6580bb408300bfd9777b0c12907d..b352f21ffb6cdaad4a7fa22bf81d2e455f4e254d 100644 --- a/module/VuFind/src/VuFind/Bootstrapper.php +++ b/module/VuFind/src/VuFind/Bootstrapper.php @@ -179,8 +179,11 @@ class Bootstrapper // the config file if this doesn't work -- different systems may vary in // their behavior here. setlocale( - LC_MONETARY, - ["{$this->config->Site->locale}.UTF-8", $this->config->Site->locale] + LC_ALL, [ + "{$this->config->Site->locale}.UTF8", + "{$this->config->Site->locale}.UTF-8", + $this->config->Site->locale + ] ); date_default_timezone_set($this->config->Site->timezone); } diff --git a/module/VuFind/src/VuFind/Controller/BrowseController.php b/module/VuFind/src/VuFind/Controller/BrowseController.php index 540eb226366260e5d3628fc3d025621e7c6b5fad..a7576dd4f4df8cf17b638a5df2c5e82a29520fdc 100644 --- a/module/VuFind/src/VuFind/Controller/BrowseController.php +++ b/module/VuFind/src/VuFind/Controller/BrowseController.php @@ -611,13 +611,10 @@ class BrowseController extends AbstractBase if (isset($this->config->Browse->alphabetical_order) && $this->config->Browse->alphabetical_order ) { - if (isset($this->config->Site->locale)) { - setlocale(LC_ALL, $this->config->Site->locale . ".utf8"); - $callback = function ($a, $b) { - return strcoll($a['displayText'], $b['displayText']); - }; - usort($result[$facet]['list'], $callback); - } + $callback = function ($a, $b) { + return strcoll($a['displayText'], $b['displayText']); + }; + usort($result[$facet]['list'], $callback); } return $result[$facet]['list']; } else { diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/SafeMoneyFormatTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/SafeMoneyFormatTest.php index 90f8248efe76117901ac3cfde658efa5f9d27f0e..7824e799be62b2e024ce26583bd4ceeee9471793 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/SafeMoneyFormatTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/SafeMoneyFormatTest.php @@ -55,7 +55,10 @@ class SafeMoneyFormatTest extends \PHPUnit_Framework_TestCase { // store current default and set a value for consistency in testing $this->locale = setlocale(LC_MONETARY, 0); - setlocale(LC_MONETARY, 'en_US.UTF8'); + $locales = ['en_US.UTF8', 'en_US.UTF-8', 'en_US']; + if (false === setlocale(LC_MONETARY, $locales)) { + $this->markTestSkipped('Problem setting up locale'); + } } /**